1#![doc = "MAVLink cubepilot dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#[cfg(feature = "arbitrary")]
5use arbitrary::Arbitrary;
6#[allow(unused_imports)]
7use bitflags::bitflags;
8use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
9#[allow(unused_imports)]
10use num_derive::FromPrimitive;
11#[allow(unused_imports)]
12use num_derive::ToPrimitive;
13#[allow(unused_imports)]
14use num_traits::FromPrimitive;
15#[allow(unused_imports)]
16use num_traits::ToPrimitive;
17#[cfg(feature = "serde")]
18use serde::{Deserialize, Serialize};
19#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
20#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21#[cfg_attr(feature = "serde", serde(tag = "type"))]
22#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23#[repr(u32)]
24#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
25pub enum ActuatorConfiguration {
26 #[doc = "Do nothing."]
27 ACTUATOR_CONFIGURATION_NONE = 0,
28 #[doc = "Command the actuator to beep now."]
29 ACTUATOR_CONFIGURATION_BEEP = 1,
30 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
31 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
32 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
33 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
34 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
35 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
36 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
37 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
38}
39impl ActuatorConfiguration {
40 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
41}
42impl Default for ActuatorConfiguration {
43 fn default() -> Self {
44 Self::DEFAULT
45 }
46}
47#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
48#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
49#[cfg_attr(feature = "serde", serde(tag = "type"))]
50#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
51#[repr(u32)]
52#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
53pub enum ActuatorOutputFunction {
54 #[doc = "No function (disabled)."]
55 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
56 #[doc = "Motor 1"]
57 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
58 #[doc = "Motor 2"]
59 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
60 #[doc = "Motor 3"]
61 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
62 #[doc = "Motor 4"]
63 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
64 #[doc = "Motor 5"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
66 #[doc = "Motor 6"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
68 #[doc = "Motor 7"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
70 #[doc = "Motor 8"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
72 #[doc = "Motor 9"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
74 #[doc = "Motor 10"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
76 #[doc = "Motor 11"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
78 #[doc = "Motor 12"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
80 #[doc = "Motor 13"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
82 #[doc = "Motor 14"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
84 #[doc = "Motor 15"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
86 #[doc = "Motor 16"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
88 #[doc = "Servo 1"]
89 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
90 #[doc = "Servo 2"]
91 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
92 #[doc = "Servo 3"]
93 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
94 #[doc = "Servo 4"]
95 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
96 #[doc = "Servo 5"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
98 #[doc = "Servo 6"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
100 #[doc = "Servo 7"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
102 #[doc = "Servo 8"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
104 #[doc = "Servo 9"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
106 #[doc = "Servo 10"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
108 #[doc = "Servo 11"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
110 #[doc = "Servo 12"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
112 #[doc = "Servo 13"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
114 #[doc = "Servo 14"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
116 #[doc = "Servo 15"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
118 #[doc = "Servo 16"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
120}
121impl ActuatorOutputFunction {
122 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
123}
124impl Default for ActuatorOutputFunction {
125 fn default() -> Self {
126 Self::DEFAULT
127 }
128}
129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
131#[cfg_attr(feature = "serde", serde(tag = "type"))]
132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
133#[repr(u32)]
134#[doc = "Enumeration of the ADSB altimeter types"]
135pub enum AdsbAltitudeType {
136 #[doc = "Altitude reported from a Baro source using QNH reference"]
137 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
138 #[doc = "Altitude reported from a GNSS source"]
139 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
140}
141impl AdsbAltitudeType {
142 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
143}
144impl Default for AdsbAltitudeType {
145 fn default() -> Self {
146 Self::DEFAULT
147 }
148}
149#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
151#[cfg_attr(feature = "serde", serde(tag = "type"))]
152#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
153#[repr(u32)]
154#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
155pub enum AdsbEmitterType {
156 ADSB_EMITTER_TYPE_NO_INFO = 0,
157 ADSB_EMITTER_TYPE_LIGHT = 1,
158 ADSB_EMITTER_TYPE_SMALL = 2,
159 ADSB_EMITTER_TYPE_LARGE = 3,
160 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
161 ADSB_EMITTER_TYPE_HEAVY = 5,
162 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
163 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
164 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
165 ADSB_EMITTER_TYPE_GLIDER = 9,
166 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
167 ADSB_EMITTER_TYPE_PARACHUTE = 11,
168 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
169 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
170 ADSB_EMITTER_TYPE_UAV = 14,
171 ADSB_EMITTER_TYPE_SPACE = 15,
172 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
173 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
174 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
175 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
176}
177impl AdsbEmitterType {
178 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
179}
180impl Default for AdsbEmitterType {
181 fn default() -> Self {
182 Self::DEFAULT
183 }
184}
185bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
186impl AdsbFlags {
187 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
188}
189impl Default for AdsbFlags {
190 fn default() -> Self {
191 Self::DEFAULT
192 }
193}
194bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
195impl AisFlags {
196 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
197}
198impl Default for AisFlags {
199 fn default() -> Self {
200 Self::DEFAULT
201 }
202}
203#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
205#[cfg_attr(feature = "serde", serde(tag = "type"))]
206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
207#[repr(u32)]
208#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
209pub enum AisNavStatus {
210 #[doc = "Under way using engine."]
211 UNDER_WAY = 0,
212 AIS_NAV_ANCHORED = 1,
213 AIS_NAV_UN_COMMANDED = 2,
214 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
215 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
216 AIS_NAV_MOORED = 5,
217 AIS_NAV_AGROUND = 6,
218 AIS_NAV_FISHING = 7,
219 AIS_NAV_SAILING = 8,
220 AIS_NAV_RESERVED_HSC = 9,
221 AIS_NAV_RESERVED_WIG = 10,
222 AIS_NAV_RESERVED_1 = 11,
223 AIS_NAV_RESERVED_2 = 12,
224 AIS_NAV_RESERVED_3 = 13,
225 #[doc = "Search And Rescue Transponder."]
226 AIS_NAV_AIS_SART = 14,
227 #[doc = "Not available (default)."]
228 AIS_NAV_UNKNOWN = 15,
229}
230impl AisNavStatus {
231 pub const DEFAULT: Self = Self::UNDER_WAY;
232}
233impl Default for AisNavStatus {
234 fn default() -> Self {
235 Self::DEFAULT
236 }
237}
238#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
240#[cfg_attr(feature = "serde", serde(tag = "type"))]
241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
242#[repr(u32)]
243#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
244pub enum AisType {
245 #[doc = "Not available (default)."]
246 AIS_TYPE_UNKNOWN = 0,
247 AIS_TYPE_RESERVED_1 = 1,
248 AIS_TYPE_RESERVED_2 = 2,
249 AIS_TYPE_RESERVED_3 = 3,
250 AIS_TYPE_RESERVED_4 = 4,
251 AIS_TYPE_RESERVED_5 = 5,
252 AIS_TYPE_RESERVED_6 = 6,
253 AIS_TYPE_RESERVED_7 = 7,
254 AIS_TYPE_RESERVED_8 = 8,
255 AIS_TYPE_RESERVED_9 = 9,
256 AIS_TYPE_RESERVED_10 = 10,
257 AIS_TYPE_RESERVED_11 = 11,
258 AIS_TYPE_RESERVED_12 = 12,
259 AIS_TYPE_RESERVED_13 = 13,
260 AIS_TYPE_RESERVED_14 = 14,
261 AIS_TYPE_RESERVED_15 = 15,
262 AIS_TYPE_RESERVED_16 = 16,
263 AIS_TYPE_RESERVED_17 = 17,
264 AIS_TYPE_RESERVED_18 = 18,
265 AIS_TYPE_RESERVED_19 = 19,
266 #[doc = "Wing In Ground effect."]
267 AIS_TYPE_WIG = 20,
268 AIS_TYPE_WIG_HAZARDOUS_A = 21,
269 AIS_TYPE_WIG_HAZARDOUS_B = 22,
270 AIS_TYPE_WIG_HAZARDOUS_C = 23,
271 AIS_TYPE_WIG_HAZARDOUS_D = 24,
272 AIS_TYPE_WIG_RESERVED_1 = 25,
273 AIS_TYPE_WIG_RESERVED_2 = 26,
274 AIS_TYPE_WIG_RESERVED_3 = 27,
275 AIS_TYPE_WIG_RESERVED_4 = 28,
276 AIS_TYPE_WIG_RESERVED_5 = 29,
277 AIS_TYPE_FISHING = 30,
278 AIS_TYPE_TOWING = 31,
279 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
280 AIS_TYPE_TOWING_LARGE = 32,
281 #[doc = "Dredging or other underwater ops."]
282 AIS_TYPE_DREDGING = 33,
283 AIS_TYPE_DIVING = 34,
284 AIS_TYPE_MILITARY = 35,
285 AIS_TYPE_SAILING = 36,
286 AIS_TYPE_PLEASURE = 37,
287 AIS_TYPE_RESERVED_20 = 38,
288 AIS_TYPE_RESERVED_21 = 39,
289 #[doc = "High Speed Craft."]
290 AIS_TYPE_HSC = 40,
291 AIS_TYPE_HSC_HAZARDOUS_A = 41,
292 AIS_TYPE_HSC_HAZARDOUS_B = 42,
293 AIS_TYPE_HSC_HAZARDOUS_C = 43,
294 AIS_TYPE_HSC_HAZARDOUS_D = 44,
295 AIS_TYPE_HSC_RESERVED_1 = 45,
296 AIS_TYPE_HSC_RESERVED_2 = 46,
297 AIS_TYPE_HSC_RESERVED_3 = 47,
298 AIS_TYPE_HSC_RESERVED_4 = 48,
299 AIS_TYPE_HSC_UNKNOWN = 49,
300 AIS_TYPE_PILOT = 50,
301 #[doc = "Search And Rescue vessel."]
302 AIS_TYPE_SAR = 51,
303 AIS_TYPE_TUG = 52,
304 AIS_TYPE_PORT_TENDER = 53,
305 #[doc = "Anti-pollution equipment."]
306 AIS_TYPE_ANTI_POLLUTION = 54,
307 AIS_TYPE_LAW_ENFORCEMENT = 55,
308 AIS_TYPE_SPARE_LOCAL_1 = 56,
309 AIS_TYPE_SPARE_LOCAL_2 = 57,
310 AIS_TYPE_MEDICAL_TRANSPORT = 58,
311 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
312 AIS_TYPE_NONECOMBATANT = 59,
313 AIS_TYPE_PASSENGER = 60,
314 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
315 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
316 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
317 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
318 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
319 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
320 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
321 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
322 AIS_TYPE_PASSENGER_UNKNOWN = 69,
323 AIS_TYPE_CARGO = 70,
324 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
325 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
326 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
327 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
328 AIS_TYPE_CARGO_RESERVED_1 = 75,
329 AIS_TYPE_CARGO_RESERVED_2 = 76,
330 AIS_TYPE_CARGO_RESERVED_3 = 77,
331 AIS_TYPE_CARGO_RESERVED_4 = 78,
332 AIS_TYPE_CARGO_UNKNOWN = 79,
333 AIS_TYPE_TANKER = 80,
334 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
335 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
336 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
337 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
338 AIS_TYPE_TANKER_RESERVED_1 = 85,
339 AIS_TYPE_TANKER_RESERVED_2 = 86,
340 AIS_TYPE_TANKER_RESERVED_3 = 87,
341 AIS_TYPE_TANKER_RESERVED_4 = 88,
342 AIS_TYPE_TANKER_UNKNOWN = 89,
343 AIS_TYPE_OTHER = 90,
344 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
345 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
346 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
347 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
348 AIS_TYPE_OTHER_RESERVED_1 = 95,
349 AIS_TYPE_OTHER_RESERVED_2 = 96,
350 AIS_TYPE_OTHER_RESERVED_3 = 97,
351 AIS_TYPE_OTHER_RESERVED_4 = 98,
352 AIS_TYPE_OTHER_UNKNOWN = 99,
353}
354impl AisType {
355 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
356}
357impl Default for AisType {
358 fn default() -> Self {
359 Self::DEFAULT
360 }
361}
362bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
363impl AttitudeTargetTypemask {
364 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
365}
366impl Default for AttitudeTargetTypemask {
367 fn default() -> Self {
368 Self::DEFAULT
369 }
370}
371#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
373#[cfg_attr(feature = "serde", serde(tag = "type"))]
374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
375#[repr(u32)]
376#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
377pub enum AutotuneAxis {
378 #[doc = "Autotune roll axis."]
379 AUTOTUNE_AXIS_ROLL = 1,
380 #[doc = "Autotune pitch axis."]
381 AUTOTUNE_AXIS_PITCH = 2,
382 #[doc = "Autotune yaw axis."]
383 AUTOTUNE_AXIS_YAW = 4,
384}
385impl AutotuneAxis {
386 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
387}
388impl Default for AutotuneAxis {
389 fn default() -> Self {
390 Self::DEFAULT
391 }
392}
393bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
394impl CameraCapFlags {
395 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
396}
397impl Default for CameraCapFlags {
398 fn default() -> Self {
399 Self::DEFAULT
400 }
401}
402#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
404#[cfg_attr(feature = "serde", serde(tag = "type"))]
405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
406#[repr(u32)]
407#[doc = "Camera Modes."]
408pub enum CameraMode {
409 #[doc = "Camera is in image/photo capture mode."]
410 CAMERA_MODE_IMAGE = 0,
411 #[doc = "Camera is in video capture mode."]
412 CAMERA_MODE_VIDEO = 1,
413 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
414 CAMERA_MODE_IMAGE_SURVEY = 2,
415}
416impl CameraMode {
417 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
418}
419impl Default for CameraMode {
420 fn default() -> Self {
421 Self::DEFAULT
422 }
423}
424#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
426#[cfg_attr(feature = "serde", serde(tag = "type"))]
427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
428#[repr(u32)]
429#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
430pub enum CameraSource {
431 #[doc = "Default camera source."]
432 CAMERA_SOURCE_DEFAULT = 0,
433 #[doc = "RGB camera source."]
434 CAMERA_SOURCE_RGB = 1,
435 #[doc = "IR camera source."]
436 CAMERA_SOURCE_IR = 2,
437 #[doc = "NDVI camera source."]
438 CAMERA_SOURCE_NDVI = 3,
439}
440impl CameraSource {
441 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
442}
443impl Default for CameraSource {
444 fn default() -> Self {
445 Self::DEFAULT
446 }
447}
448#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
450#[cfg_attr(feature = "serde", serde(tag = "type"))]
451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
452#[repr(u32)]
453#[doc = "Camera tracking modes"]
454pub enum CameraTrackingMode {
455 #[doc = "Not tracking"]
456 CAMERA_TRACKING_MODE_NONE = 0,
457 #[doc = "Target is a point"]
458 CAMERA_TRACKING_MODE_POINT = 1,
459 #[doc = "Target is a rectangle"]
460 CAMERA_TRACKING_MODE_RECTANGLE = 2,
461}
462impl CameraTrackingMode {
463 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
464}
465impl Default for CameraTrackingMode {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
471#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
472#[cfg_attr(feature = "serde", serde(tag = "type"))]
473#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
474#[repr(u32)]
475#[doc = "Camera tracking status flags"]
476pub enum CameraTrackingStatusFlags {
477 #[doc = "Camera is not tracking"]
478 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
479 #[doc = "Camera is tracking"]
480 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
481 #[doc = "Camera tracking in error state"]
482 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
483}
484impl CameraTrackingStatusFlags {
485 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
486}
487impl Default for CameraTrackingStatusFlags {
488 fn default() -> Self {
489 Self::DEFAULT
490 }
491}
492bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
493impl CameraTrackingTargetData {
494 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
495}
496impl Default for CameraTrackingTargetData {
497 fn default() -> Self {
498 Self::DEFAULT
499 }
500}
501#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
502#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
503#[cfg_attr(feature = "serde", serde(tag = "type"))]
504#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
505#[repr(u32)]
506#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
507pub enum CameraZoomType {
508 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
509 ZOOM_TYPE_STEP = 0,
510 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
511 ZOOM_TYPE_CONTINUOUS = 1,
512 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
513 ZOOM_TYPE_RANGE = 2,
514 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
515 ZOOM_TYPE_FOCAL_LENGTH = 3,
516 #[doc = "Zoom value as horizontal field of view in degrees."]
517 ZOOM_TYPE_HORIZONTAL_FOV = 4,
518}
519impl CameraZoomType {
520 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
521}
522impl Default for CameraZoomType {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
529#[cfg_attr(feature = "serde", serde(tag = "type"))]
530#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
531#[repr(u32)]
532pub enum CanFilterOp {
533 CAN_FILTER_REPLACE = 0,
534 CAN_FILTER_ADD = 1,
535 CAN_FILTER_REMOVE = 2,
536}
537impl CanFilterOp {
538 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
539}
540impl Default for CanFilterOp {
541 fn default() -> Self {
542 Self::DEFAULT
543 }
544}
545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
547#[cfg_attr(feature = "serde", serde(tag = "type"))]
548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
549#[repr(u32)]
550#[doc = "Possible responses from a CELLULAR_CONFIG message."]
551pub enum CellularConfigResponse {
552 #[doc = "Changes accepted."]
553 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
554 #[doc = "Invalid APN."]
555 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
556 #[doc = "Invalid PIN."]
557 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
558 #[doc = "Changes rejected."]
559 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
560 #[doc = "PUK is required to unblock SIM card."]
561 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
562}
563impl CellularConfigResponse {
564 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
565}
566impl Default for CellularConfigResponse {
567 fn default() -> Self {
568 Self::DEFAULT
569 }
570}
571#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
573#[cfg_attr(feature = "serde", serde(tag = "type"))]
574#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
575#[repr(u32)]
576#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
577pub enum CellularNetworkFailedReason {
578 #[doc = "No error"]
579 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
580 #[doc = "Error state is unknown"]
581 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
582 #[doc = "SIM is required for the modem but missing"]
583 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
584 #[doc = "SIM is available, but not usable for connection"]
585 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
586}
587impl CellularNetworkFailedReason {
588 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
589}
590impl Default for CellularNetworkFailedReason {
591 fn default() -> Self {
592 Self::DEFAULT
593 }
594}
595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
597#[cfg_attr(feature = "serde", serde(tag = "type"))]
598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
599#[repr(u32)]
600#[doc = "Cellular network radio type"]
601pub enum CellularNetworkRadioType {
602 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
603 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
604 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
605 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
606 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
607}
608impl CellularNetworkRadioType {
609 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
610}
611impl Default for CellularNetworkRadioType {
612 fn default() -> Self {
613 Self::DEFAULT
614 }
615}
616#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
618#[cfg_attr(feature = "serde", serde(tag = "type"))]
619#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
620#[repr(u32)]
621#[doc = "These flags encode the cellular network status"]
622pub enum CellularStatusFlag {
623 #[doc = "State unknown or not reportable."]
624 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
625 #[doc = "Modem is unusable"]
626 CELLULAR_STATUS_FLAG_FAILED = 1,
627 #[doc = "Modem is being initialized"]
628 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
629 #[doc = "Modem is locked"]
630 CELLULAR_STATUS_FLAG_LOCKED = 3,
631 #[doc = "Modem is not enabled and is powered down"]
632 CELLULAR_STATUS_FLAG_DISABLED = 4,
633 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
634 CELLULAR_STATUS_FLAG_DISABLING = 5,
635 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
636 CELLULAR_STATUS_FLAG_ENABLING = 6,
637 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
638 CELLULAR_STATUS_FLAG_ENABLED = 7,
639 #[doc = "Modem is searching for a network provider to register"]
640 CELLULAR_STATUS_FLAG_SEARCHING = 8,
641 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
642 CELLULAR_STATUS_FLAG_REGISTERED = 9,
643 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
644 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
645 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
646 CELLULAR_STATUS_FLAG_CONNECTING = 11,
647 #[doc = "One or more packet data bearers is active and connected"]
648 CELLULAR_STATUS_FLAG_CONNECTED = 12,
649}
650impl CellularStatusFlag {
651 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
652}
653impl Default for CellularStatusFlag {
654 fn default() -> Self {
655 Self::DEFAULT
656 }
657}
658#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
659#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
660#[cfg_attr(feature = "serde", serde(tag = "type"))]
661#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
662#[repr(u32)]
663#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
664pub enum CompMetadataType {
665 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
666 COMP_METADATA_TYPE_GENERAL = 0,
667 #[doc = "Parameter meta data."]
668 COMP_METADATA_TYPE_PARAMETER = 1,
669 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
670 COMP_METADATA_TYPE_COMMANDS = 2,
671 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
672 COMP_METADATA_TYPE_PERIPHERALS = 3,
673 #[doc = "Meta data for the events interface."]
674 COMP_METADATA_TYPE_EVENTS = 4,
675 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
676 COMP_METADATA_TYPE_ACTUATORS = 5,
677}
678impl CompMetadataType {
679 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
680}
681impl Default for CompMetadataType {
682 fn default() -> Self {
683 Self::DEFAULT
684 }
685}
686#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
688#[cfg_attr(feature = "serde", serde(tag = "type"))]
689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
690#[repr(u32)]
691#[doc = "Indicates the ESC connection type."]
692pub enum EscConnectionType {
693 #[doc = "Traditional PPM ESC."]
694 ESC_CONNECTION_TYPE_PPM = 0,
695 #[doc = "Serial Bus connected ESC."]
696 ESC_CONNECTION_TYPE_SERIAL = 1,
697 #[doc = "One Shot PPM ESC."]
698 ESC_CONNECTION_TYPE_ONESHOT = 2,
699 #[doc = "I2C ESC."]
700 ESC_CONNECTION_TYPE_I2C = 3,
701 #[doc = "CAN-Bus ESC."]
702 ESC_CONNECTION_TYPE_CAN = 4,
703 #[doc = "DShot ESC."]
704 ESC_CONNECTION_TYPE_DSHOT = 5,
705}
706impl EscConnectionType {
707 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
708}
709impl Default for EscConnectionType {
710 fn default() -> Self {
711 Self::DEFAULT
712 }
713}
714bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
715impl EscFailureFlags {
716 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
717}
718impl Default for EscFailureFlags {
719 fn default() -> Self {
720 Self::DEFAULT
721 }
722}
723bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
724impl EstimatorStatusFlags {
725 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
726}
727impl Default for EstimatorStatusFlags {
728 fn default() -> Self {
729 Self::DEFAULT
730 }
731}
732#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
734#[cfg_attr(feature = "serde", serde(tag = "type"))]
735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
736#[repr(u32)]
737#[doc = "List of possible failure type to inject."]
738pub enum FailureType {
739 #[doc = "No failure injected, used to reset a previous failure."]
740 FAILURE_TYPE_OK = 0,
741 #[doc = "Sets unit off, so completely non-responsive."]
742 FAILURE_TYPE_OFF = 1,
743 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
744 FAILURE_TYPE_STUCK = 2,
745 #[doc = "Unit is reporting complete garbage."]
746 FAILURE_TYPE_GARBAGE = 3,
747 #[doc = "Unit is consistently wrong."]
748 FAILURE_TYPE_WRONG = 4,
749 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
750 FAILURE_TYPE_SLOW = 5,
751 #[doc = "Data of unit is delayed in time."]
752 FAILURE_TYPE_DELAYED = 6,
753 #[doc = "Unit is sometimes working, sometimes not."]
754 FAILURE_TYPE_INTERMITTENT = 7,
755}
756impl FailureType {
757 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
758}
759impl Default for FailureType {
760 fn default() -> Self {
761 Self::DEFAULT
762 }
763}
764#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
766#[cfg_attr(feature = "serde", serde(tag = "type"))]
767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
768#[repr(u32)]
769#[doc = "List of possible units where failures can be injected."]
770pub enum FailureUnit {
771 FAILURE_UNIT_SENSOR_GYRO = 0,
772 FAILURE_UNIT_SENSOR_ACCEL = 1,
773 FAILURE_UNIT_SENSOR_MAG = 2,
774 FAILURE_UNIT_SENSOR_BARO = 3,
775 FAILURE_UNIT_SENSOR_GPS = 4,
776 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
777 FAILURE_UNIT_SENSOR_VIO = 6,
778 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
779 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
780 FAILURE_UNIT_SYSTEM_BATTERY = 100,
781 FAILURE_UNIT_SYSTEM_MOTOR = 101,
782 FAILURE_UNIT_SYSTEM_SERVO = 102,
783 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
784 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
785 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
786}
787impl FailureUnit {
788 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
789}
790impl Default for FailureUnit {
791 fn default() -> Self {
792 Self::DEFAULT
793 }
794}
795#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
797#[cfg_attr(feature = "serde", serde(tag = "type"))]
798#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
799#[repr(u32)]
800pub enum FenceBreach {
801 #[doc = "No last fence breach"]
802 FENCE_BREACH_NONE = 0,
803 #[doc = "Breached minimum altitude"]
804 FENCE_BREACH_MINALT = 1,
805 #[doc = "Breached maximum altitude"]
806 FENCE_BREACH_MAXALT = 2,
807 #[doc = "Breached fence boundary"]
808 FENCE_BREACH_BOUNDARY = 3,
809}
810impl FenceBreach {
811 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
812}
813impl Default for FenceBreach {
814 fn default() -> Self {
815 Self::DEFAULT
816 }
817}
818#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
820#[cfg_attr(feature = "serde", serde(tag = "type"))]
821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
822#[repr(u32)]
823#[doc = "Actions being taken to mitigate/prevent fence breach"]
824pub enum FenceMitigate {
825 #[doc = "Unknown"]
826 FENCE_MITIGATE_UNKNOWN = 0,
827 #[doc = "No actions being taken"]
828 FENCE_MITIGATE_NONE = 1,
829 #[doc = "Velocity limiting active to prevent breach"]
830 FENCE_MITIGATE_VEL_LIMIT = 2,
831}
832impl FenceMitigate {
833 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
834}
835impl Default for FenceMitigate {
836 fn default() -> Self {
837 Self::DEFAULT
838 }
839}
840#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
842#[cfg_attr(feature = "serde", serde(tag = "type"))]
843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
844#[repr(u32)]
845#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
846pub enum FenceType {
847 #[doc = "Maximum altitude fence"]
848 FENCE_TYPE_ALT_MAX = 1,
849 #[doc = "Circle fence"]
850 FENCE_TYPE_CIRCLE = 2,
851 #[doc = "Polygon fence"]
852 FENCE_TYPE_POLYGON = 4,
853 #[doc = "Minimum altitude fence"]
854 FENCE_TYPE_ALT_MIN = 8,
855}
856impl FenceType {
857 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
858}
859impl Default for FenceType {
860 fn default() -> Self {
861 Self::DEFAULT
862 }
863}
864#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
865#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
866#[cfg_attr(feature = "serde", serde(tag = "type"))]
867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
868#[repr(u32)]
869#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
870pub enum FirmwareVersionType {
871 #[doc = "development release"]
872 FIRMWARE_VERSION_TYPE_DEV = 0,
873 #[doc = "alpha release"]
874 FIRMWARE_VERSION_TYPE_ALPHA = 64,
875 #[doc = "beta release"]
876 FIRMWARE_VERSION_TYPE_BETA = 128,
877 #[doc = "release candidate"]
878 FIRMWARE_VERSION_TYPE_RC = 192,
879 #[doc = "official stable release"]
880 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
881}
882impl FirmwareVersionType {
883 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
884}
885impl Default for FirmwareVersionType {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
891impl GimbalDeviceCapFlags {
892 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
893}
894impl Default for GimbalDeviceCapFlags {
895 fn default() -> Self {
896 Self::DEFAULT
897 }
898}
899bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
900impl GimbalDeviceErrorFlags {
901 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
902}
903impl Default for GimbalDeviceErrorFlags {
904 fn default() -> Self {
905 Self::DEFAULT
906 }
907}
908bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
909impl GimbalDeviceFlags {
910 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
911}
912impl Default for GimbalDeviceFlags {
913 fn default() -> Self {
914 Self::DEFAULT
915 }
916}
917bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
918impl GimbalManagerCapFlags {
919 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
920}
921impl Default for GimbalManagerCapFlags {
922 fn default() -> Self {
923 Self::DEFAULT
924 }
925}
926bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
927impl GimbalManagerFlags {
928 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
929}
930impl Default for GimbalManagerFlags {
931 fn default() -> Self {
932 Self::DEFAULT
933 }
934}
935#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
937#[cfg_attr(feature = "serde", serde(tag = "type"))]
938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
939#[repr(u32)]
940#[doc = "Type of GPS fix"]
941pub enum GpsFixType {
942 #[doc = "No GPS connected"]
943 GPS_FIX_TYPE_NO_GPS = 0,
944 #[doc = "No position information, GPS is connected"]
945 GPS_FIX_TYPE_NO_FIX = 1,
946 #[doc = "2D position"]
947 GPS_FIX_TYPE_2D_FIX = 2,
948 #[doc = "3D position"]
949 GPS_FIX_TYPE_3D_FIX = 3,
950 #[doc = "DGPS/SBAS aided 3D position"]
951 GPS_FIX_TYPE_DGPS = 4,
952 #[doc = "RTK float, 3D position"]
953 GPS_FIX_TYPE_RTK_FLOAT = 5,
954 #[doc = "RTK Fixed, 3D position"]
955 GPS_FIX_TYPE_RTK_FIXED = 6,
956 #[doc = "Static fixed, typically used for base stations"]
957 GPS_FIX_TYPE_STATIC = 7,
958 #[doc = "PPP, 3D position."]
959 GPS_FIX_TYPE_PPP = 8,
960}
961impl GpsFixType {
962 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
963}
964impl Default for GpsFixType {
965 fn default() -> Self {
966 Self::DEFAULT
967 }
968}
969bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
970impl GpsInputIgnoreFlags {
971 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
972}
973impl Default for GpsInputIgnoreFlags {
974 fn default() -> Self {
975 Self::DEFAULT
976 }
977}
978#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
980#[cfg_attr(feature = "serde", serde(tag = "type"))]
981#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
982#[repr(u32)]
983#[doc = "Gripper actions."]
984pub enum GripperActions {
985 #[doc = "Gripper release cargo."]
986 GRIPPER_ACTION_RELEASE = 0,
987 #[doc = "Gripper grab onto cargo."]
988 GRIPPER_ACTION_GRAB = 1,
989}
990impl GripperActions {
991 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
992}
993impl Default for GripperActions {
994 fn default() -> Self {
995 Self::DEFAULT
996 }
997}
998bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
999impl HighresImuUpdatedFlags {
1000 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1001}
1002impl Default for HighresImuUpdatedFlags {
1003 fn default() -> Self {
1004 Self::DEFAULT
1005 }
1006}
1007bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1008impl HilActuatorControlsFlags {
1009 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1010}
1011impl Default for HilActuatorControlsFlags {
1012 fn default() -> Self {
1013 Self::DEFAULT
1014 }
1015}
1016bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1017impl HilSensorUpdatedFlags {
1018 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1019}
1020impl Default for HilSensorUpdatedFlags {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1026impl HlFailureFlag {
1027 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1028}
1029impl Default for HlFailureFlag {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1035impl IlluminatorErrorFlags {
1036 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1037}
1038impl Default for IlluminatorErrorFlags {
1039 fn default() -> Self {
1040 Self::DEFAULT
1041 }
1042}
1043#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1044#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1045#[cfg_attr(feature = "serde", serde(tag = "type"))]
1046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1047#[repr(u32)]
1048#[doc = "Modes of illuminator"]
1049pub enum IlluminatorMode {
1050 #[doc = "Illuminator mode is not specified/unknown"]
1051 ILLUMINATOR_MODE_UNKNOWN = 0,
1052 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1053 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1054 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1055 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1056}
1057impl IlluminatorMode {
1058 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1059}
1060impl Default for IlluminatorMode {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1066#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1067#[cfg_attr(feature = "serde", serde(tag = "type"))]
1068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1069#[repr(u32)]
1070#[doc = "Type of landing target"]
1071pub enum LandingTargetType {
1072 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1073 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1074 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1075 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1076 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1077 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1078 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1079 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1080}
1081impl LandingTargetType {
1082 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1083}
1084impl Default for LandingTargetType {
1085 fn default() -> Self {
1086 Self::DEFAULT
1087 }
1088}
1089#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1091#[cfg_attr(feature = "serde", serde(tag = "type"))]
1092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1093#[repr(u32)]
1094pub enum MagCalStatus {
1095 MAG_CAL_NOT_STARTED = 0,
1096 MAG_CAL_WAITING_TO_START = 1,
1097 MAG_CAL_RUNNING_STEP_ONE = 2,
1098 MAG_CAL_RUNNING_STEP_TWO = 3,
1099 MAG_CAL_SUCCESS = 4,
1100 MAG_CAL_FAILED = 5,
1101 MAG_CAL_BAD_ORIENTATION = 6,
1102 MAG_CAL_BAD_RADIUS = 7,
1103}
1104impl MagCalStatus {
1105 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1106}
1107impl Default for MagCalStatus {
1108 fn default() -> Self {
1109 Self::DEFAULT
1110 }
1111}
1112#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1113#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1114#[cfg_attr(feature = "serde", serde(tag = "type"))]
1115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1116#[repr(u32)]
1117pub enum MavArmAuthDeniedReason {
1118 #[doc = "Not a specific reason"]
1119 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1120 #[doc = "Authorizer will send the error as string to GCS"]
1121 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1122 #[doc = "At least one waypoint have a invalid value"]
1123 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1124 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1125 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1126 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1127 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1128 #[doc = "Weather is not good to fly"]
1129 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1130}
1131impl MavArmAuthDeniedReason {
1132 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1133}
1134impl Default for MavArmAuthDeniedReason {
1135 fn default() -> Self {
1136 Self::DEFAULT
1137 }
1138}
1139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1141#[cfg_attr(feature = "serde", serde(tag = "type"))]
1142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1143#[repr(u32)]
1144#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1145pub enum MavAutopilot {
1146 #[doc = "Generic autopilot, full support for everything"]
1147 MAV_AUTOPILOT_GENERIC = 0,
1148 #[doc = "Reserved for future use."]
1149 MAV_AUTOPILOT_RESERVED = 1,
1150 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1151 MAV_AUTOPILOT_SLUGS = 2,
1152 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1153 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1154 #[doc = "OpenPilot, <http://openpilot.org>"]
1155 MAV_AUTOPILOT_OPENPILOT = 4,
1156 #[doc = "Generic autopilot only supporting simple waypoints"]
1157 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1158 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1159 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1160 #[doc = "Generic autopilot supporting the full mission command set"]
1161 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1162 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1163 MAV_AUTOPILOT_INVALID = 8,
1164 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1165 MAV_AUTOPILOT_PPZ = 9,
1166 #[doc = "UAV Dev Board"]
1167 MAV_AUTOPILOT_UDB = 10,
1168 #[doc = "FlexiPilot"]
1169 MAV_AUTOPILOT_FP = 11,
1170 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1171 MAV_AUTOPILOT_PX4 = 12,
1172 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1173 MAV_AUTOPILOT_SMACCMPILOT = 13,
1174 #[doc = "AutoQuad -- <http://autoquad.org>"]
1175 MAV_AUTOPILOT_AUTOQUAD = 14,
1176 #[doc = "Armazila -- <http://armazila.com>"]
1177 MAV_AUTOPILOT_ARMAZILA = 15,
1178 #[doc = "Aerob -- <http://aerob.ru>"]
1179 MAV_AUTOPILOT_AEROB = 16,
1180 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1181 MAV_AUTOPILOT_ASLUAV = 17,
1182 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1183 MAV_AUTOPILOT_SMARTAP = 18,
1184 #[doc = "AirRails - <http://uaventure.com>"]
1185 MAV_AUTOPILOT_AIRRAILS = 19,
1186 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1187 MAV_AUTOPILOT_REFLEX = 20,
1188}
1189impl MavAutopilot {
1190 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1191}
1192impl Default for MavAutopilot {
1193 fn default() -> Self {
1194 Self::DEFAULT
1195 }
1196}
1197#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1199#[cfg_attr(feature = "serde", serde(tag = "type"))]
1200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1201#[repr(u32)]
1202#[doc = "Enumeration for battery charge states."]
1203pub enum MavBatteryChargeState {
1204 #[doc = "Low battery state is not provided"]
1205 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1206 #[doc = "Battery is not in low state. Normal operation."]
1207 MAV_BATTERY_CHARGE_STATE_OK = 1,
1208 #[doc = "Battery state is low, warn and monitor close."]
1209 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1210 #[doc = "Battery state is critical, return or abort immediately."]
1211 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1212 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1213 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1214 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1215 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1216 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1217 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1218 #[doc = "Battery is charging."]
1219 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1220}
1221impl MavBatteryChargeState {
1222 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1223}
1224impl Default for MavBatteryChargeState {
1225 fn default() -> Self {
1226 Self::DEFAULT
1227 }
1228}
1229bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1230impl MavBatteryFault {
1231 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1232}
1233impl Default for MavBatteryFault {
1234 fn default() -> Self {
1235 Self::DEFAULT
1236 }
1237}
1238#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1240#[cfg_attr(feature = "serde", serde(tag = "type"))]
1241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1242#[repr(u32)]
1243#[doc = "Enumeration of battery functions"]
1244pub enum MavBatteryFunction {
1245 #[doc = "Battery function is unknown"]
1246 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1247 #[doc = "Battery supports all flight systems"]
1248 MAV_BATTERY_FUNCTION_ALL = 1,
1249 #[doc = "Battery for the propulsion system"]
1250 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1251 #[doc = "Avionics battery"]
1252 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1253 #[doc = "Payload battery"]
1254 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1255}
1256impl MavBatteryFunction {
1257 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1258}
1259impl Default for MavBatteryFunction {
1260 fn default() -> Self {
1261 Self::DEFAULT
1262 }
1263}
1264#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1265#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1266#[cfg_attr(feature = "serde", serde(tag = "type"))]
1267#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1268#[repr(u32)]
1269#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1270pub enum MavBatteryMode {
1271 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1272 MAV_BATTERY_MODE_UNKNOWN = 0,
1273 #[doc = "Battery is auto discharging (towards storage level)."]
1274 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1275 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1276 MAV_BATTERY_MODE_HOT_SWAP = 2,
1277}
1278impl MavBatteryMode {
1279 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1280}
1281impl Default for MavBatteryMode {
1282 fn default() -> Self {
1283 Self::DEFAULT
1284 }
1285}
1286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1288#[cfg_attr(feature = "serde", serde(tag = "type"))]
1289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1290#[repr(u32)]
1291#[doc = "Enumeration of battery types"]
1292pub enum MavBatteryType {
1293 #[doc = "Not specified."]
1294 MAV_BATTERY_TYPE_UNKNOWN = 0,
1295 #[doc = "Lithium polymer battery"]
1296 MAV_BATTERY_TYPE_LIPO = 1,
1297 #[doc = "Lithium-iron-phosphate battery"]
1298 MAV_BATTERY_TYPE_LIFE = 2,
1299 #[doc = "Lithium-ION battery"]
1300 MAV_BATTERY_TYPE_LION = 3,
1301 #[doc = "Nickel metal hydride battery"]
1302 MAV_BATTERY_TYPE_NIMH = 4,
1303}
1304impl MavBatteryType {
1305 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1306}
1307impl Default for MavBatteryType {
1308 fn default() -> Self {
1309 Self::DEFAULT
1310 }
1311}
1312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1314#[cfg_attr(feature = "serde", serde(tag = "type"))]
1315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1316#[repr(u32)]
1317#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1318pub enum MavCmd {
1319 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1320 MAV_CMD_NAV_WAYPOINT = 16,
1321 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1322 MAV_CMD_NAV_LOITER_UNLIM = 17,
1323 #[doc = "Loiter around this waypoint for X turns"]
1324 MAV_CMD_NAV_LOITER_TURNS = 18,
1325 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1326 MAV_CMD_NAV_LOITER_TIME = 19,
1327 #[doc = "Return to launch location"]
1328 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1329 #[doc = "Land at location."]
1330 MAV_CMD_NAV_LAND = 21,
1331 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1332 MAV_CMD_NAV_TAKEOFF = 22,
1333 #[doc = "Land at local position (local frame only)"]
1334 MAV_CMD_NAV_LAND_LOCAL = 23,
1335 #[doc = "Takeoff from local position (local frame only)"]
1336 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1337 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1338 MAV_CMD_NAV_FOLLOW = 25,
1339 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1340 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1341 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1342 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1343 #[doc = "Begin following a target"]
1344 MAV_CMD_DO_FOLLOW = 32,
1345 #[doc = "Reposition the MAV after a follow target command has been sent"]
1346 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1347 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1348 MAV_CMD_DO_ORBIT = 34,
1349 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1350 MAV_CMD_NAV_ROI = 80,
1351 #[doc = "Control autonomous path planning on the MAV."]
1352 MAV_CMD_NAV_PATHPLANNING = 81,
1353 #[doc = "Navigate to waypoint using a spline path."]
1354 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1355 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1356 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1357 #[doc = "Land using VTOL mode"]
1358 MAV_CMD_NAV_VTOL_LAND = 85,
1359 #[doc = "hand control over to an external controller"]
1360 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1361 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1362 MAV_CMD_NAV_DELAY = 93,
1363 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1364 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1365 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1366 MAV_CMD_NAV_LAST = 95,
1367 #[doc = "Delay mission state machine."]
1368 MAV_CMD_CONDITION_DELAY = 112,
1369 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1370 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1371 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1372 MAV_CMD_CONDITION_DISTANCE = 114,
1373 #[doc = "Reach a certain target angle."]
1374 MAV_CMD_CONDITION_YAW = 115,
1375 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1376 MAV_CMD_CONDITION_LAST = 159,
1377 #[doc = "Set system mode."]
1378 MAV_CMD_DO_SET_MODE = 176,
1379 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1380 MAV_CMD_DO_JUMP = 177,
1381 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1382 MAV_CMD_DO_CHANGE_SPEED = 178,
1383 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1384 MAV_CMD_DO_SET_HOME = 179,
1385 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1386 MAV_CMD_DO_SET_PARAMETER = 180,
1387 #[doc = "Set a relay to a condition."]
1388 MAV_CMD_DO_SET_RELAY = 181,
1389 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1390 MAV_CMD_DO_REPEAT_RELAY = 182,
1391 #[doc = "Set a servo to a desired PWM value."]
1392 MAV_CMD_DO_SET_SERVO = 183,
1393 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1394 MAV_CMD_DO_REPEAT_SERVO = 184,
1395 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1396 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1397 #[doc = "Change altitude set point."]
1398 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1399 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1400 MAV_CMD_DO_SET_ACTUATOR = 187,
1401 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1402 MAV_CMD_DO_RETURN_PATH_START = 188,
1403 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1404 MAV_CMD_DO_LAND_START = 189,
1405 #[doc = "Mission command to perform a landing from a rally point."]
1406 MAV_CMD_DO_RALLY_LAND = 190,
1407 #[doc = "Mission command to safely abort an autonomous landing."]
1408 MAV_CMD_DO_GO_AROUND = 191,
1409 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1410 MAV_CMD_DO_REPOSITION = 192,
1411 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1412 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1413 #[doc = "Set moving direction to forward or reverse."]
1414 MAV_CMD_DO_SET_REVERSE = 194,
1415 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1416 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1417 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1418 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1419 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1420 MAV_CMD_DO_SET_ROI_NONE = 197,
1421 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1422 MAV_CMD_DO_SET_ROI_SYSID = 198,
1423 #[doc = "Control onboard camera system."]
1424 MAV_CMD_DO_CONTROL_VIDEO = 200,
1425 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1426 MAV_CMD_DO_SET_ROI = 201,
1427 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1428 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1429 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1430 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1431 #[doc = "Mission command to configure a camera or antenna mount"]
1432 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1433 #[doc = "Mission command to control a camera or antenna mount"]
1434 MAV_CMD_DO_MOUNT_CONTROL = 205,
1435 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1436 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1437 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1438 MAV_CMD_DO_FENCE_ENABLE = 207,
1439 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1440 MAV_CMD_DO_PARACHUTE = 208,
1441 #[doc = "Command to perform motor test."]
1442 MAV_CMD_DO_MOTOR_TEST = 209,
1443 #[doc = "Change to/from inverted flight."]
1444 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1445 #[doc = "Mission command to operate a gripper."]
1446 MAV_CMD_DO_GRIPPER = 211,
1447 #[doc = "Enable/disable autotune."]
1448 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1449 #[doc = "Sets a desired vehicle turn angle and speed change."]
1450 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1451 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1452 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1453 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1454 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1455 #[doc = "set id of master controller"]
1456 MAV_CMD_DO_GUIDED_MASTER = 221,
1457 #[doc = "Set limits for external control"]
1458 MAV_CMD_DO_GUIDED_LIMITS = 222,
1459 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1460 MAV_CMD_DO_ENGINE_CONTROL = 223,
1461 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1462 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1463 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1464 MAV_CMD_DO_LAST = 240,
1465 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1466 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1467 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1468 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1469 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1470 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1471 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1472 MAV_CMD_PREFLIGHT_STORAGE = 245,
1473 #[doc = "Request the reboot or shutdown of system components."]
1474 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1475 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1476 MAV_CMD_OVERRIDE_GOTO = 252,
1477 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1478 MAV_CMD_OBLIQUE_SURVEY = 260,
1479 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1480 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1481 #[doc = "start running a mission"]
1482 MAV_CMD_MISSION_START = 300,
1483 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1484 MAV_CMD_ACTUATOR_TEST = 310,
1485 #[doc = "Actuator configuration command."]
1486 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1487 #[doc = "Arms / Disarms a component"]
1488 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1489 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1490 MAV_CMD_RUN_PREARM_CHECKS = 401,
1491 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1492 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1493 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1494 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1495 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1496 MAV_CMD_GET_HOME_POSITION = 410,
1497 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1498 MAV_CMD_INJECT_FAILURE = 420,
1499 #[doc = "Starts receiver pairing."]
1500 MAV_CMD_START_RX_PAIR = 500,
1501 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1502 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1503 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1504 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1505 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1506 MAV_CMD_REQUEST_MESSAGE = 512,
1507 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1508 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1509 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1510 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1511 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1512 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1513 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1514 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1515 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1516 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1517 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1518 MAV_CMD_STORAGE_FORMAT = 526,
1519 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1520 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1521 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1522 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1523 #[doc = "Reset all camera settings to Factory Default"]
1524 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1525 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1526 MAV_CMD_SET_CAMERA_MODE = 530,
1527 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1528 MAV_CMD_SET_CAMERA_ZOOM = 531,
1529 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1530 MAV_CMD_SET_CAMERA_FOCUS = 532,
1531 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1532 MAV_CMD_SET_STORAGE_USAGE = 533,
1533 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1534 MAV_CMD_SET_CAMERA_SOURCE = 534,
1535 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1536 MAV_CMD_JUMP_TAG = 600,
1537 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1538 MAV_CMD_DO_JUMP_TAG = 601,
1539 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1540 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1541 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1542 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1543 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1544 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1545 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1546 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1547 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1548 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1549 #[doc = "Enable or disable on-board camera triggering system."]
1550 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1551 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1552 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1553 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1554 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1555 #[doc = "Stops ongoing tracking."]
1556 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1557 #[doc = "Starts video capture (recording)."]
1558 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1559 #[doc = "Stop the current video capture (recording)."]
1560 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1561 #[doc = "Start video streaming"]
1562 MAV_CMD_VIDEO_START_STREAMING = 2502,
1563 #[doc = "Stop the given video stream"]
1564 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1565 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1566 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1567 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1568 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1569 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1570 MAV_CMD_LOGGING_START = 2510,
1571 #[doc = "Request to stop streaming log data over MAVLink"]
1572 MAV_CMD_LOGGING_STOP = 2511,
1573 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1574 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1575 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1576 #[doc = "Create a panorama at the current position"]
1577 MAV_CMD_PANORAMA_CREATE = 2800,
1578 #[doc = "Request VTOL transition"]
1579 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1580 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1581 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1582 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1583 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1584 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1585 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1586 #[doc = "Delay mission state machine until gate has been reached."]
1587 MAV_CMD_CONDITION_GATE = 4501,
1588 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1589 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1590 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1591 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1592 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1593 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1594 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1595 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1596 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1597 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1598 #[doc = "Rally point. You can have multiple rally points defined."]
1599 MAV_CMD_NAV_RALLY_POINT = 5100,
1600 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1601 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1602 #[doc = "Change state of safety switch."]
1603 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1604 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1605 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1606 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1607 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1608 #[doc = "Control the payload deployment."]
1609 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1610 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1611 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1612 #[doc = "Command to operate winch."]
1613 MAV_CMD_DO_WINCH = 42600,
1614 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1615 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1616 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1617 MAV_CMD_WAYPOINT_USER_1 = 31000,
1618 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1619 MAV_CMD_WAYPOINT_USER_2 = 31001,
1620 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1621 MAV_CMD_WAYPOINT_USER_3 = 31002,
1622 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1623 MAV_CMD_WAYPOINT_USER_4 = 31003,
1624 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1625 MAV_CMD_WAYPOINT_USER_5 = 31004,
1626 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1627 MAV_CMD_SPATIAL_USER_1 = 31005,
1628 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1629 MAV_CMD_SPATIAL_USER_2 = 31006,
1630 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1631 MAV_CMD_SPATIAL_USER_3 = 31007,
1632 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1633 MAV_CMD_SPATIAL_USER_4 = 31008,
1634 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1635 MAV_CMD_SPATIAL_USER_5 = 31009,
1636 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1637 MAV_CMD_USER_1 = 31010,
1638 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1639 MAV_CMD_USER_2 = 31011,
1640 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1641 MAV_CMD_USER_3 = 31012,
1642 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1643 MAV_CMD_USER_4 = 31013,
1644 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1645 MAV_CMD_USER_5 = 31014,
1646 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1647 MAV_CMD_CAN_FORWARD = 32000,
1648}
1649impl MavCmd {
1650 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1651}
1652impl Default for MavCmd {
1653 fn default() -> Self {
1654 Self::DEFAULT
1655 }
1656}
1657#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1659#[cfg_attr(feature = "serde", serde(tag = "type"))]
1660#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1661#[repr(u32)]
1662#[doc = "Possible actions an aircraft can take to avoid a collision."]
1663pub enum MavCollisionAction {
1664 #[doc = "Ignore any potential collisions"]
1665 MAV_COLLISION_ACTION_NONE = 0,
1666 #[doc = "Report potential collision"]
1667 MAV_COLLISION_ACTION_REPORT = 1,
1668 #[doc = "Ascend or Descend to avoid threat"]
1669 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1670 #[doc = "Move horizontally to avoid threat"]
1671 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1672 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1673 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1674 #[doc = "Aircraft to fly directly back to its launch point"]
1675 MAV_COLLISION_ACTION_RTL = 5,
1676 #[doc = "Aircraft to stop in place"]
1677 MAV_COLLISION_ACTION_HOVER = 6,
1678}
1679impl MavCollisionAction {
1680 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1681}
1682impl Default for MavCollisionAction {
1683 fn default() -> Self {
1684 Self::DEFAULT
1685 }
1686}
1687#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1689#[cfg_attr(feature = "serde", serde(tag = "type"))]
1690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1691#[repr(u32)]
1692#[doc = "Source of information about this collision."]
1693pub enum MavCollisionSrc {
1694 #[doc = "ID field references ADSB_VEHICLE packets"]
1695 MAV_COLLISION_SRC_ADSB = 0,
1696 #[doc = "ID field references MAVLink SRC ID"]
1697 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1698}
1699impl MavCollisionSrc {
1700 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1701}
1702impl Default for MavCollisionSrc {
1703 fn default() -> Self {
1704 Self::DEFAULT
1705 }
1706}
1707#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1709#[cfg_attr(feature = "serde", serde(tag = "type"))]
1710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1711#[repr(u32)]
1712#[doc = "Aircraft-rated danger from this threat."]
1713pub enum MavCollisionThreatLevel {
1714 #[doc = "Not a threat"]
1715 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1716 #[doc = "Craft is mildly concerned about this threat"]
1717 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1718 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1719 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1720}
1721impl MavCollisionThreatLevel {
1722 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1723}
1724impl Default for MavCollisionThreatLevel {
1725 fn default() -> Self {
1726 Self::DEFAULT
1727 }
1728}
1729#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1731#[cfg_attr(feature = "serde", serde(tag = "type"))]
1732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1733#[repr(u32)]
1734#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1735pub enum MavComponent {
1736 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1737 MAV_COMP_ID_ALL = 0,
1738 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1739 MAV_COMP_ID_AUTOPILOT1 = 1,
1740 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1741 MAV_COMP_ID_USER1 = 25,
1742 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1743 MAV_COMP_ID_USER2 = 26,
1744 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1745 MAV_COMP_ID_USER3 = 27,
1746 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1747 MAV_COMP_ID_USER4 = 28,
1748 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1749 MAV_COMP_ID_USER5 = 29,
1750 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1751 MAV_COMP_ID_USER6 = 30,
1752 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1753 MAV_COMP_ID_USER7 = 31,
1754 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1755 MAV_COMP_ID_USER8 = 32,
1756 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1757 MAV_COMP_ID_USER9 = 33,
1758 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1759 MAV_COMP_ID_USER10 = 34,
1760 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1761 MAV_COMP_ID_USER11 = 35,
1762 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1763 MAV_COMP_ID_USER12 = 36,
1764 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1765 MAV_COMP_ID_USER13 = 37,
1766 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1767 MAV_COMP_ID_USER14 = 38,
1768 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1769 MAV_COMP_ID_USER15 = 39,
1770 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1771 MAV_COMP_ID_USER16 = 40,
1772 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1773 MAV_COMP_ID_USER17 = 41,
1774 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1775 MAV_COMP_ID_USER18 = 42,
1776 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1777 MAV_COMP_ID_USER19 = 43,
1778 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1779 MAV_COMP_ID_USER20 = 44,
1780 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1781 MAV_COMP_ID_USER21 = 45,
1782 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1783 MAV_COMP_ID_USER22 = 46,
1784 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1785 MAV_COMP_ID_USER23 = 47,
1786 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1787 MAV_COMP_ID_USER24 = 48,
1788 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1789 MAV_COMP_ID_USER25 = 49,
1790 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1791 MAV_COMP_ID_USER26 = 50,
1792 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1793 MAV_COMP_ID_USER27 = 51,
1794 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1795 MAV_COMP_ID_USER28 = 52,
1796 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1797 MAV_COMP_ID_USER29 = 53,
1798 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1799 MAV_COMP_ID_USER30 = 54,
1800 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1801 MAV_COMP_ID_USER31 = 55,
1802 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1803 MAV_COMP_ID_USER32 = 56,
1804 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1805 MAV_COMP_ID_USER33 = 57,
1806 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1807 MAV_COMP_ID_USER34 = 58,
1808 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1809 MAV_COMP_ID_USER35 = 59,
1810 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1811 MAV_COMP_ID_USER36 = 60,
1812 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1813 MAV_COMP_ID_USER37 = 61,
1814 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1815 MAV_COMP_ID_USER38 = 62,
1816 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1817 MAV_COMP_ID_USER39 = 63,
1818 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1819 MAV_COMP_ID_USER40 = 64,
1820 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1821 MAV_COMP_ID_USER41 = 65,
1822 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1823 MAV_COMP_ID_USER42 = 66,
1824 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1825 MAV_COMP_ID_USER43 = 67,
1826 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1827 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1828 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1829 MAV_COMP_ID_USER45 = 69,
1830 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1831 MAV_COMP_ID_USER46 = 70,
1832 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1833 MAV_COMP_ID_USER47 = 71,
1834 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1835 MAV_COMP_ID_USER48 = 72,
1836 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1837 MAV_COMP_ID_USER49 = 73,
1838 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1839 MAV_COMP_ID_USER50 = 74,
1840 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1841 MAV_COMP_ID_USER51 = 75,
1842 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1843 MAV_COMP_ID_USER52 = 76,
1844 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1845 MAV_COMP_ID_USER53 = 77,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER54 = 78,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER55 = 79,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER56 = 80,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER57 = 81,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER58 = 82,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER59 = 83,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER60 = 84,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER61 = 85,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER62 = 86,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER63 = 87,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER64 = 88,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER65 = 89,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER66 = 90,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER67 = 91,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER68 = 92,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER69 = 93,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER70 = 94,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER71 = 95,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER72 = 96,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER73 = 97,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER74 = 98,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER75 = 99,
1890 #[doc = "Camera #1."]
1891 MAV_COMP_ID_CAMERA = 100,
1892 #[doc = "Camera #2."]
1893 MAV_COMP_ID_CAMERA2 = 101,
1894 #[doc = "Camera #3."]
1895 MAV_COMP_ID_CAMERA3 = 102,
1896 #[doc = "Camera #4."]
1897 MAV_COMP_ID_CAMERA4 = 103,
1898 #[doc = "Camera #5."]
1899 MAV_COMP_ID_CAMERA5 = 104,
1900 #[doc = "Camera #6."]
1901 MAV_COMP_ID_CAMERA6 = 105,
1902 #[doc = "Servo #1."]
1903 MAV_COMP_ID_SERVO1 = 140,
1904 #[doc = "Servo #2."]
1905 MAV_COMP_ID_SERVO2 = 141,
1906 #[doc = "Servo #3."]
1907 MAV_COMP_ID_SERVO3 = 142,
1908 #[doc = "Servo #4."]
1909 MAV_COMP_ID_SERVO4 = 143,
1910 #[doc = "Servo #5."]
1911 MAV_COMP_ID_SERVO5 = 144,
1912 #[doc = "Servo #6."]
1913 MAV_COMP_ID_SERVO6 = 145,
1914 #[doc = "Servo #7."]
1915 MAV_COMP_ID_SERVO7 = 146,
1916 #[doc = "Servo #8."]
1917 MAV_COMP_ID_SERVO8 = 147,
1918 #[doc = "Servo #9."]
1919 MAV_COMP_ID_SERVO9 = 148,
1920 #[doc = "Servo #10."]
1921 MAV_COMP_ID_SERVO10 = 149,
1922 #[doc = "Servo #11."]
1923 MAV_COMP_ID_SERVO11 = 150,
1924 #[doc = "Servo #12."]
1925 MAV_COMP_ID_SERVO12 = 151,
1926 #[doc = "Servo #13."]
1927 MAV_COMP_ID_SERVO13 = 152,
1928 #[doc = "Servo #14."]
1929 MAV_COMP_ID_SERVO14 = 153,
1930 #[doc = "Gimbal #1."]
1931 MAV_COMP_ID_GIMBAL = 154,
1932 #[doc = "Logging component."]
1933 MAV_COMP_ID_LOG = 155,
1934 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
1935 MAV_COMP_ID_ADSB = 156,
1936 #[doc = "On Screen Display (OSD) devices for video links."]
1937 MAV_COMP_ID_OSD = 157,
1938 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
1939 MAV_COMP_ID_PERIPHERAL = 158,
1940 #[doc = "Gimbal ID for QX1."]
1941 MAV_COMP_ID_QX1_GIMBAL = 159,
1942 #[doc = "FLARM collision alert component."]
1943 MAV_COMP_ID_FLARM = 160,
1944 #[doc = "Parachute component."]
1945 MAV_COMP_ID_PARACHUTE = 161,
1946 #[doc = "Winch component."]
1947 MAV_COMP_ID_WINCH = 169,
1948 #[doc = "Gimbal #2."]
1949 MAV_COMP_ID_GIMBAL2 = 171,
1950 #[doc = "Gimbal #3."]
1951 MAV_COMP_ID_GIMBAL3 = 172,
1952 #[doc = "Gimbal #4"]
1953 MAV_COMP_ID_GIMBAL4 = 173,
1954 #[doc = "Gimbal #5."]
1955 MAV_COMP_ID_GIMBAL5 = 174,
1956 #[doc = "Gimbal #6."]
1957 MAV_COMP_ID_GIMBAL6 = 175,
1958 #[doc = "Battery #1."]
1959 MAV_COMP_ID_BATTERY = 180,
1960 #[doc = "Battery #2."]
1961 MAV_COMP_ID_BATTERY2 = 181,
1962 #[doc = "CAN over MAVLink client."]
1963 MAV_COMP_ID_MAVCAN = 189,
1964 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
1965 MAV_COMP_ID_MISSIONPLANNER = 190,
1966 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1967 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
1968 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1969 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
1970 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1971 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
1972 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1973 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
1974 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
1975 MAV_COMP_ID_PATHPLANNER = 195,
1976 #[doc = "Component that plans a collision free path between two points."]
1977 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
1978 #[doc = "Component that provides position estimates using VIO techniques."]
1979 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
1980 #[doc = "Component that manages pairing of vehicle and GCS."]
1981 MAV_COMP_ID_PAIRING_MANAGER = 198,
1982 #[doc = "Inertial Measurement Unit (IMU) #1."]
1983 MAV_COMP_ID_IMU = 200,
1984 #[doc = "Inertial Measurement Unit (IMU) #2."]
1985 MAV_COMP_ID_IMU_2 = 201,
1986 #[doc = "Inertial Measurement Unit (IMU) #3."]
1987 MAV_COMP_ID_IMU_3 = 202,
1988 #[doc = "GPS #1."]
1989 MAV_COMP_ID_GPS = 220,
1990 #[doc = "GPS #2."]
1991 MAV_COMP_ID_GPS2 = 221,
1992 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
1993 MAV_COMP_ID_ODID_TXRX_1 = 236,
1994 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
1995 MAV_COMP_ID_ODID_TXRX_2 = 237,
1996 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
1997 MAV_COMP_ID_ODID_TXRX_3 = 238,
1998 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
1999 MAV_COMP_ID_UDP_BRIDGE = 240,
2000 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2001 MAV_COMP_ID_UART_BRIDGE = 241,
2002 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2003 MAV_COMP_ID_TUNNEL_NODE = 242,
2004 #[doc = "Illuminator"]
2005 MAV_COMP_ID_ILLUMINATOR = 243,
2006 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2007 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2008}
2009impl MavComponent {
2010 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2011}
2012impl Default for MavComponent {
2013 fn default() -> Self {
2014 Self::DEFAULT
2015 }
2016}
2017#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2019#[cfg_attr(feature = "serde", serde(tag = "type"))]
2020#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2021#[repr(u32)]
2022#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2023pub enum MavDataStream {
2024 #[doc = "Enable all data streams"]
2025 MAV_DATA_STREAM_ALL = 0,
2026 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2027 MAV_DATA_STREAM_RAW_SENSORS = 1,
2028 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2029 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2030 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2031 MAV_DATA_STREAM_RC_CHANNELS = 3,
2032 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2033 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2034 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2035 MAV_DATA_STREAM_POSITION = 6,
2036 #[doc = "Dependent on the autopilot"]
2037 MAV_DATA_STREAM_EXTRA1 = 10,
2038 #[doc = "Dependent on the autopilot"]
2039 MAV_DATA_STREAM_EXTRA2 = 11,
2040 #[doc = "Dependent on the autopilot"]
2041 MAV_DATA_STREAM_EXTRA3 = 12,
2042}
2043impl MavDataStream {
2044 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2045}
2046impl Default for MavDataStream {
2047 fn default() -> Self {
2048 Self::DEFAULT
2049 }
2050}
2051#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2053#[cfg_attr(feature = "serde", serde(tag = "type"))]
2054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2055#[repr(u32)]
2056#[doc = "Enumeration of distance sensor types"]
2057pub enum MavDistanceSensor {
2058 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2059 MAV_DISTANCE_SENSOR_LASER = 0,
2060 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2061 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2062 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2063 MAV_DISTANCE_SENSOR_INFRARED = 2,
2064 #[doc = "Radar type, e.g. uLanding units"]
2065 MAV_DISTANCE_SENSOR_RADAR = 3,
2066 #[doc = "Broken or unknown type, e.g. analog units"]
2067 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2068}
2069impl MavDistanceSensor {
2070 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2071}
2072impl Default for MavDistanceSensor {
2073 fn default() -> Self {
2074 Self::DEFAULT
2075 }
2076}
2077#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2079#[cfg_attr(feature = "serde", serde(tag = "type"))]
2080#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2081#[repr(u32)]
2082#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2083pub enum MavDoRepositionFlags {
2084 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2085 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2086}
2087impl MavDoRepositionFlags {
2088 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2089}
2090impl Default for MavDoRepositionFlags {
2091 fn default() -> Self {
2092 Self::DEFAULT
2093 }
2094}
2095#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2096#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2097#[cfg_attr(feature = "serde", serde(tag = "type"))]
2098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2099#[repr(u32)]
2100#[doc = "Enumeration of estimator types"]
2101pub enum MavEstimatorType {
2102 #[doc = "Unknown type of the estimator."]
2103 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2104 #[doc = "This is a naive estimator without any real covariance feedback."]
2105 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2106 #[doc = "Computer vision based estimate. Might be up to scale."]
2107 MAV_ESTIMATOR_TYPE_VISION = 2,
2108 #[doc = "Visual-inertial estimate."]
2109 MAV_ESTIMATOR_TYPE_VIO = 3,
2110 #[doc = "Plain GPS estimate."]
2111 MAV_ESTIMATOR_TYPE_GPS = 4,
2112 #[doc = "Estimator integrating GPS and inertial sensing."]
2113 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2114 #[doc = "Estimate from external motion capturing system."]
2115 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2116 #[doc = "Estimator based on lidar sensor input."]
2117 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2118 #[doc = "Estimator on autopilot."]
2119 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2120}
2121impl MavEstimatorType {
2122 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2123}
2124impl Default for MavEstimatorType {
2125 fn default() -> Self {
2126 Self::DEFAULT
2127 }
2128}
2129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2131#[cfg_attr(feature = "serde", serde(tag = "type"))]
2132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2133#[repr(u32)]
2134#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2135pub enum MavEventCurrentSequenceFlags {
2136 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2137 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2138}
2139impl MavEventCurrentSequenceFlags {
2140 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2141}
2142impl Default for MavEventCurrentSequenceFlags {
2143 fn default() -> Self {
2144 Self::DEFAULT
2145 }
2146}
2147#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2149#[cfg_attr(feature = "serde", serde(tag = "type"))]
2150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2151#[repr(u32)]
2152#[doc = "Reason for an event error response."]
2153pub enum MavEventErrorReason {
2154 #[doc = "The requested event is not available (anymore)."]
2155 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2156}
2157impl MavEventErrorReason {
2158 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2159}
2160impl Default for MavEventErrorReason {
2161 fn default() -> Self {
2162 Self::DEFAULT
2163 }
2164}
2165#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2167#[cfg_attr(feature = "serde", serde(tag = "type"))]
2168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2169#[repr(u32)]
2170#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2171pub enum MavFrame {
2172 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2173 MAV_FRAME_GLOBAL = 0,
2174 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2175 MAV_FRAME_LOCAL_NED = 1,
2176 #[doc = "NOT a coordinate frame, indicates a mission command."]
2177 MAV_FRAME_MISSION = 2,
2178 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2179 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2180 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2181 MAV_FRAME_LOCAL_ENU = 4,
2182 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2183 MAV_FRAME_GLOBAL_INT = 5,
2184 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2185 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2186 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2187 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2188 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2189 MAV_FRAME_BODY_NED = 8,
2190 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2191 MAV_FRAME_BODY_OFFSET_NED = 9,
2192 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2193 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2194 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2195 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2196 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2197 MAV_FRAME_BODY_FRD = 12,
2198 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2199 MAV_FRAME_RESERVED_13 = 13,
2200 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2201 MAV_FRAME_RESERVED_14 = 14,
2202 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2203 MAV_FRAME_RESERVED_15 = 15,
2204 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2205 MAV_FRAME_RESERVED_16 = 16,
2206 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2207 MAV_FRAME_RESERVED_17 = 17,
2208 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2209 MAV_FRAME_RESERVED_18 = 18,
2210 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2211 MAV_FRAME_RESERVED_19 = 19,
2212 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2213 MAV_FRAME_LOCAL_FRD = 20,
2214 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2215 MAV_FRAME_LOCAL_FLU = 21,
2216}
2217impl MavFrame {
2218 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2219}
2220impl Default for MavFrame {
2221 fn default() -> Self {
2222 Self::DEFAULT
2223 }
2224}
2225#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2226#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2227#[cfg_attr(feature = "serde", serde(tag = "type"))]
2228#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2229#[repr(u32)]
2230#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2231pub enum MavFtpErr {
2232 #[doc = "None: No error"]
2233 MAV_FTP_ERR_NONE = 0,
2234 #[doc = "Fail: Unknown failure"]
2235 MAV_FTP_ERR_FAIL = 1,
2236 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2237 MAV_FTP_ERR_FAILERRNO = 2,
2238 #[doc = "InvalidDataSize: Payload size is invalid"]
2239 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2240 #[doc = "InvalidSession: Session is not currently open"]
2241 MAV_FTP_ERR_INVALIDSESSION = 4,
2242 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2243 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2244 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2245 MAV_FTP_ERR_EOF = 6,
2246 #[doc = "UnknownCommand: Unknown command / opcode"]
2247 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2248 #[doc = "FileExists: File/directory already exists"]
2249 MAV_FTP_ERR_FILEEXISTS = 8,
2250 #[doc = "FileProtected: File/directory is write protected"]
2251 MAV_FTP_ERR_FILEPROTECTED = 9,
2252 #[doc = "FileNotFound: File/directory not found"]
2253 MAV_FTP_ERR_FILENOTFOUND = 10,
2254}
2255impl MavFtpErr {
2256 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2257}
2258impl Default for MavFtpErr {
2259 fn default() -> Self {
2260 Self::DEFAULT
2261 }
2262}
2263#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2265#[cfg_attr(feature = "serde", serde(tag = "type"))]
2266#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2267#[repr(u32)]
2268#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2269pub enum MavFtpOpcode {
2270 #[doc = "None. Ignored, always ACKed"]
2271 MAV_FTP_OPCODE_NONE = 0,
2272 #[doc = "TerminateSession: Terminates open Read session"]
2273 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2274 #[doc = "ResetSessions: Terminates all open read sessions"]
2275 MAV_FTP_OPCODE_RESETSESSION = 2,
2276 #[doc = "ListDirectory. List files and directories in path from offset"]
2277 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2278 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2279 MAV_FTP_OPCODE_OPENFILERO = 4,
2280 #[doc = "ReadFile: Reads size bytes from offset in session"]
2281 MAV_FTP_OPCODE_READFILE = 5,
2282 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2283 MAV_FTP_OPCODE_CREATEFILE = 6,
2284 #[doc = "WriteFile: Writes size bytes to offset in session"]
2285 MAV_FTP_OPCODE_WRITEFILE = 7,
2286 #[doc = "RemoveFile: Remove file at path"]
2287 MAV_FTP_OPCODE_REMOVEFILE = 8,
2288 #[doc = "CreateDirectory: Creates directory at path"]
2289 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2290 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2291 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2292 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2293 MAV_FTP_OPCODE_OPENFILEWO = 11,
2294 #[doc = "TruncateFile: Truncate file at path to offset length"]
2295 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2296 #[doc = "Rename: Rename path1 to path2"]
2297 MAV_FTP_OPCODE_RENAME = 13,
2298 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2299 MAV_FTP_OPCODE_CALCFILECRC = 14,
2300 #[doc = "BurstReadFile: Burst download session file"]
2301 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2302 #[doc = "ACK: ACK response"]
2303 MAV_FTP_OPCODE_ACK = 128,
2304 #[doc = "NAK: NAK response"]
2305 MAV_FTP_OPCODE_NAK = 129,
2306}
2307impl MavFtpOpcode {
2308 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2309}
2310impl Default for MavFtpOpcode {
2311 fn default() -> Self {
2312 Self::DEFAULT
2313 }
2314}
2315#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2317#[cfg_attr(feature = "serde", serde(tag = "type"))]
2318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2319#[repr(u32)]
2320#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2321pub enum MavFuelType {
2322 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2323 MAV_FUEL_TYPE_UNKNOWN = 0,
2324 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2325 MAV_FUEL_TYPE_LIQUID = 1,
2326 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2327 MAV_FUEL_TYPE_GAS = 2,
2328}
2329impl MavFuelType {
2330 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2331}
2332impl Default for MavFuelType {
2333 fn default() -> Self {
2334 Self::DEFAULT
2335 }
2336}
2337bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2338impl MavGeneratorStatusFlag {
2339 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2340}
2341impl Default for MavGeneratorStatusFlag {
2342 fn default() -> Self {
2343 Self::DEFAULT
2344 }
2345}
2346#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2348#[cfg_attr(feature = "serde", serde(tag = "type"))]
2349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2350#[repr(u32)]
2351#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2352pub enum MavGoto {
2353 #[doc = "Hold at the current position."]
2354 MAV_GOTO_DO_HOLD = 0,
2355 #[doc = "Continue with the next item in mission execution."]
2356 MAV_GOTO_DO_CONTINUE = 1,
2357 #[doc = "Hold at the current position of the system"]
2358 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2359 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2360 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2361}
2362impl MavGoto {
2363 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2364}
2365impl Default for MavGoto {
2366 fn default() -> Self {
2367 Self::DEFAULT
2368 }
2369}
2370#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2372#[cfg_attr(feature = "serde", serde(tag = "type"))]
2373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2374#[repr(u32)]
2375#[doc = "Enumeration of landed detector states"]
2376pub enum MavLandedState {
2377 #[doc = "MAV landed state is unknown"]
2378 MAV_LANDED_STATE_UNDEFINED = 0,
2379 #[doc = "MAV is landed (on ground)"]
2380 MAV_LANDED_STATE_ON_GROUND = 1,
2381 #[doc = "MAV is in air"]
2382 MAV_LANDED_STATE_IN_AIR = 2,
2383 #[doc = "MAV currently taking off"]
2384 MAV_LANDED_STATE_TAKEOFF = 3,
2385 #[doc = "MAV currently landing"]
2386 MAV_LANDED_STATE_LANDING = 4,
2387}
2388impl MavLandedState {
2389 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2390}
2391impl Default for MavLandedState {
2392 fn default() -> Self {
2393 Self::DEFAULT
2394 }
2395}
2396#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2397#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2398#[cfg_attr(feature = "serde", serde(tag = "type"))]
2399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2400#[repr(u32)]
2401#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2402pub enum MavMissionResult {
2403 #[doc = "mission accepted OK"]
2404 MAV_MISSION_ACCEPTED = 0,
2405 #[doc = "Generic error / not accepting mission commands at all right now."]
2406 MAV_MISSION_ERROR = 1,
2407 #[doc = "Coordinate frame is not supported."]
2408 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2409 #[doc = "Command is not supported."]
2410 MAV_MISSION_UNSUPPORTED = 3,
2411 #[doc = "Mission items exceed storage space."]
2412 MAV_MISSION_NO_SPACE = 4,
2413 #[doc = "One of the parameters has an invalid value."]
2414 MAV_MISSION_INVALID = 5,
2415 #[doc = "param1 has an invalid value."]
2416 MAV_MISSION_INVALID_PARAM1 = 6,
2417 #[doc = "param2 has an invalid value."]
2418 MAV_MISSION_INVALID_PARAM2 = 7,
2419 #[doc = "param3 has an invalid value."]
2420 MAV_MISSION_INVALID_PARAM3 = 8,
2421 #[doc = "param4 has an invalid value."]
2422 MAV_MISSION_INVALID_PARAM4 = 9,
2423 #[doc = "x / param5 has an invalid value."]
2424 MAV_MISSION_INVALID_PARAM5_X = 10,
2425 #[doc = "y / param6 has an invalid value."]
2426 MAV_MISSION_INVALID_PARAM6_Y = 11,
2427 #[doc = "z / param7 has an invalid value."]
2428 MAV_MISSION_INVALID_PARAM7 = 12,
2429 #[doc = "Mission item received out of sequence"]
2430 MAV_MISSION_INVALID_SEQUENCE = 13,
2431 #[doc = "Not accepting any mission commands from this communication partner."]
2432 MAV_MISSION_DENIED = 14,
2433 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2434 MAV_MISSION_OPERATION_CANCELLED = 15,
2435}
2436impl MavMissionResult {
2437 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2438}
2439impl Default for MavMissionResult {
2440 fn default() -> Self {
2441 Self::DEFAULT
2442 }
2443}
2444#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2446#[cfg_attr(feature = "serde", serde(tag = "type"))]
2447#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2448#[repr(u32)]
2449#[doc = "Type of mission items being requested/sent in mission protocol."]
2450pub enum MavMissionType {
2451 #[doc = "Items are mission commands for main mission."]
2452 MAV_MISSION_TYPE_MISSION = 0,
2453 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2454 MAV_MISSION_TYPE_FENCE = 1,
2455 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2456 MAV_MISSION_TYPE_RALLY = 2,
2457 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2458 MAV_MISSION_TYPE_ALL = 255,
2459}
2460impl MavMissionType {
2461 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2462}
2463impl Default for MavMissionType {
2464 fn default() -> Self {
2465 Self::DEFAULT
2466 }
2467}
2468#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2469#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2470#[cfg_attr(feature = "serde", serde(tag = "type"))]
2471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2472#[repr(u32)]
2473#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2474pub enum MavMode {
2475 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2476 MAV_MODE_PREFLIGHT = 0,
2477 #[doc = "System is allowed to be active, under assisted RC control."]
2478 MAV_MODE_STABILIZE_DISARMED = 80,
2479 #[doc = "System is allowed to be active, under assisted RC control."]
2480 MAV_MODE_STABILIZE_ARMED = 208,
2481 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2482 MAV_MODE_MANUAL_DISARMED = 64,
2483 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2484 MAV_MODE_MANUAL_ARMED = 192,
2485 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2486 MAV_MODE_GUIDED_DISARMED = 88,
2487 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2488 MAV_MODE_GUIDED_ARMED = 216,
2489 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2490 MAV_MODE_AUTO_DISARMED = 92,
2491 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2492 MAV_MODE_AUTO_ARMED = 220,
2493 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2494 MAV_MODE_TEST_DISARMED = 66,
2495 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2496 MAV_MODE_TEST_ARMED = 194,
2497}
2498impl MavMode {
2499 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2500}
2501impl Default for MavMode {
2502 fn default() -> Self {
2503 Self::DEFAULT
2504 }
2505}
2506bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2507impl MavModeFlag {
2508 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2509}
2510impl Default for MavModeFlag {
2511 fn default() -> Self {
2512 Self::DEFAULT
2513 }
2514}
2515#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2517#[cfg_attr(feature = "serde", serde(tag = "type"))]
2518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2519#[repr(u32)]
2520#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2521pub enum MavModeFlagDecodePosition {
2522 #[doc = "First bit: 10000000"]
2523 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2524 #[doc = "Second bit: 01000000"]
2525 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2526 #[doc = "Third bit: 00100000"]
2527 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2528 #[doc = "Fourth bit: 00010000"]
2529 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2530 #[doc = "Fifth bit: 00001000"]
2531 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2532 #[doc = "Sixth bit: 00000100"]
2533 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2534 #[doc = "Seventh bit: 00000010"]
2535 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2536 #[doc = "Eighth bit: 00000001"]
2537 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2538}
2539impl MavModeFlagDecodePosition {
2540 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2541}
2542impl Default for MavModeFlagDecodePosition {
2543 fn default() -> Self {
2544 Self::DEFAULT
2545 }
2546}
2547bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2548impl MavModeProperty {
2549 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2550}
2551impl Default for MavModeProperty {
2552 fn default() -> Self {
2553 Self::DEFAULT
2554 }
2555}
2556#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2557#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2558#[cfg_attr(feature = "serde", serde(tag = "type"))]
2559#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2560#[repr(u32)]
2561#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2562pub enum MavMountMode {
2563 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2564 MAV_MOUNT_MODE_RETRACT = 0,
2565 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2566 MAV_MOUNT_MODE_NEUTRAL = 1,
2567 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2568 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2569 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2570 MAV_MOUNT_MODE_RC_TARGETING = 3,
2571 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2572 MAV_MOUNT_MODE_GPS_POINT = 4,
2573 #[doc = "Gimbal tracks system with specified system ID"]
2574 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2575 #[doc = "Gimbal tracks home position"]
2576 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2577}
2578impl MavMountMode {
2579 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2580}
2581impl Default for MavMountMode {
2582 fn default() -> Self {
2583 Self::DEFAULT
2584 }
2585}
2586#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2587#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2588#[cfg_attr(feature = "serde", serde(tag = "type"))]
2589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2590#[repr(u32)]
2591pub enum MavOdidArmStatus {
2592 #[doc = "Passing arming checks."]
2593 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2594 #[doc = "Generic arming failure, see error string for details."]
2595 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2596}
2597impl MavOdidArmStatus {
2598 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2599}
2600impl Default for MavOdidArmStatus {
2601 fn default() -> Self {
2602 Self::DEFAULT
2603 }
2604}
2605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2607#[cfg_attr(feature = "serde", serde(tag = "type"))]
2608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2609#[repr(u32)]
2610pub enum MavOdidAuthType {
2611 #[doc = "No authentication type is specified."]
2612 MAV_ODID_AUTH_TYPE_NONE = 0,
2613 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2614 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2615 #[doc = "Signature for the Operator ID."]
2616 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2617 #[doc = "Signature for the entire message set."]
2618 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2619 #[doc = "Authentication is provided by Network Remote ID."]
2620 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2621 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2622 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2623}
2624impl MavOdidAuthType {
2625 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2626}
2627impl Default for MavOdidAuthType {
2628 fn default() -> Self {
2629 Self::DEFAULT
2630 }
2631}
2632#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2633#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2634#[cfg_attr(feature = "serde", serde(tag = "type"))]
2635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2636#[repr(u32)]
2637pub enum MavOdidCategoryEu {
2638 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2639 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2640 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2641 MAV_ODID_CATEGORY_EU_OPEN = 1,
2642 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2643 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2644 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2645 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2646}
2647impl MavOdidCategoryEu {
2648 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2649}
2650impl Default for MavOdidCategoryEu {
2651 fn default() -> Self {
2652 Self::DEFAULT
2653 }
2654}
2655#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2656#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2657#[cfg_attr(feature = "serde", serde(tag = "type"))]
2658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2659#[repr(u32)]
2660pub enum MavOdidClassEu {
2661 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2662 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2663 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2664 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2665 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2666 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2667 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2668 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2669 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2670 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2671 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2672 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2673 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2674 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2675 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2676 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2677}
2678impl MavOdidClassEu {
2679 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2680}
2681impl Default for MavOdidClassEu {
2682 fn default() -> Self {
2683 Self::DEFAULT
2684 }
2685}
2686#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2688#[cfg_attr(feature = "serde", serde(tag = "type"))]
2689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2690#[repr(u32)]
2691pub enum MavOdidClassificationType {
2692 #[doc = "The classification type for the UA is undeclared."]
2693 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2694 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2695 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2696}
2697impl MavOdidClassificationType {
2698 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2699}
2700impl Default for MavOdidClassificationType {
2701 fn default() -> Self {
2702 Self::DEFAULT
2703 }
2704}
2705#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2706#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2707#[cfg_attr(feature = "serde", serde(tag = "type"))]
2708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2709#[repr(u32)]
2710pub enum MavOdidDescType {
2711 #[doc = "Optional free-form text description of the purpose of the flight."]
2712 MAV_ODID_DESC_TYPE_TEXT = 0,
2713 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2714 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2715 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2716 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2717}
2718impl MavOdidDescType {
2719 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2720}
2721impl Default for MavOdidDescType {
2722 fn default() -> Self {
2723 Self::DEFAULT
2724 }
2725}
2726#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2728#[cfg_attr(feature = "serde", serde(tag = "type"))]
2729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2730#[repr(u32)]
2731pub enum MavOdidHeightRef {
2732 #[doc = "The height field is relative to the take-off location."]
2733 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2734 #[doc = "The height field is relative to ground."]
2735 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2736}
2737impl MavOdidHeightRef {
2738 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2739}
2740impl Default for MavOdidHeightRef {
2741 fn default() -> Self {
2742 Self::DEFAULT
2743 }
2744}
2745#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2747#[cfg_attr(feature = "serde", serde(tag = "type"))]
2748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2749#[repr(u32)]
2750pub enum MavOdidHorAcc {
2751 #[doc = "The horizontal accuracy is unknown."]
2752 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2753 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2754 MAV_ODID_HOR_ACC_10NM = 1,
2755 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2756 MAV_ODID_HOR_ACC_4NM = 2,
2757 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2758 MAV_ODID_HOR_ACC_2NM = 3,
2759 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2760 MAV_ODID_HOR_ACC_1NM = 4,
2761 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2762 MAV_ODID_HOR_ACC_0_5NM = 5,
2763 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2764 MAV_ODID_HOR_ACC_0_3NM = 6,
2765 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2766 MAV_ODID_HOR_ACC_0_1NM = 7,
2767 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2768 MAV_ODID_HOR_ACC_0_05NM = 8,
2769 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2770 MAV_ODID_HOR_ACC_30_METER = 9,
2771 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2772 MAV_ODID_HOR_ACC_10_METER = 10,
2773 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2774 MAV_ODID_HOR_ACC_3_METER = 11,
2775 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2776 MAV_ODID_HOR_ACC_1_METER = 12,
2777}
2778impl MavOdidHorAcc {
2779 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2780}
2781impl Default for MavOdidHorAcc {
2782 fn default() -> Self {
2783 Self::DEFAULT
2784 }
2785}
2786#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2788#[cfg_attr(feature = "serde", serde(tag = "type"))]
2789#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2790#[repr(u32)]
2791pub enum MavOdidIdType {
2792 #[doc = "No type defined."]
2793 MAV_ODID_ID_TYPE_NONE = 0,
2794 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2795 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2796 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2797 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2798 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2799 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2800 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2801 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2802}
2803impl MavOdidIdType {
2804 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2805}
2806impl Default for MavOdidIdType {
2807 fn default() -> Self {
2808 Self::DEFAULT
2809 }
2810}
2811#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2813#[cfg_attr(feature = "serde", serde(tag = "type"))]
2814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2815#[repr(u32)]
2816pub enum MavOdidOperatorIdType {
2817 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2818 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2819}
2820impl MavOdidOperatorIdType {
2821 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2822}
2823impl Default for MavOdidOperatorIdType {
2824 fn default() -> Self {
2825 Self::DEFAULT
2826 }
2827}
2828#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2830#[cfg_attr(feature = "serde", serde(tag = "type"))]
2831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2832#[repr(u32)]
2833pub enum MavOdidOperatorLocationType {
2834 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2835 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2836 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2837 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2838 #[doc = "The location/altitude of the operator are fixed values."]
2839 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2840}
2841impl MavOdidOperatorLocationType {
2842 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2843}
2844impl Default for MavOdidOperatorLocationType {
2845 fn default() -> Self {
2846 Self::DEFAULT
2847 }
2848}
2849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2851#[cfg_attr(feature = "serde", serde(tag = "type"))]
2852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2853#[repr(u32)]
2854pub enum MavOdidSpeedAcc {
2855 #[doc = "The speed accuracy is unknown."]
2856 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2857 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2858 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2859 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2860 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2861 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2862 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2863 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2864 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2865}
2866impl MavOdidSpeedAcc {
2867 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2868}
2869impl Default for MavOdidSpeedAcc {
2870 fn default() -> Self {
2871 Self::DEFAULT
2872 }
2873}
2874#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2876#[cfg_attr(feature = "serde", serde(tag = "type"))]
2877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2878#[repr(u32)]
2879pub enum MavOdidStatus {
2880 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2881 MAV_ODID_STATUS_UNDECLARED = 0,
2882 #[doc = "The UA is on the ground."]
2883 MAV_ODID_STATUS_GROUND = 1,
2884 #[doc = "The UA is in the air."]
2885 MAV_ODID_STATUS_AIRBORNE = 2,
2886 #[doc = "The UA is having an emergency."]
2887 MAV_ODID_STATUS_EMERGENCY = 3,
2888 #[doc = "The remote ID system is failing or unreliable in some way."]
2889 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2890}
2891impl MavOdidStatus {
2892 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2893}
2894impl Default for MavOdidStatus {
2895 fn default() -> Self {
2896 Self::DEFAULT
2897 }
2898}
2899#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2900#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2901#[cfg_attr(feature = "serde", serde(tag = "type"))]
2902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2903#[repr(u32)]
2904pub enum MavOdidTimeAcc {
2905 #[doc = "The timestamp accuracy is unknown."]
2906 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2907 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2908 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2909 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2910 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2911 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2912 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2913 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
2914 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
2915 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
2916 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
2917 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
2918 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
2919 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
2920 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
2921 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
2922 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
2923 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
2924 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
2925 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
2926 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
2927 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
2928 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
2929 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
2930 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
2931 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
2932 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
2933 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
2934 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
2935 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
2936 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
2937}
2938impl MavOdidTimeAcc {
2939 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
2940}
2941impl Default for MavOdidTimeAcc {
2942 fn default() -> Self {
2943 Self::DEFAULT
2944 }
2945}
2946#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2948#[cfg_attr(feature = "serde", serde(tag = "type"))]
2949#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2950#[repr(u32)]
2951pub enum MavOdidUaType {
2952 #[doc = "No UA (Unmanned Aircraft) type defined."]
2953 MAV_ODID_UA_TYPE_NONE = 0,
2954 #[doc = "Aeroplane/Airplane. Fixed wing."]
2955 MAV_ODID_UA_TYPE_AEROPLANE = 1,
2956 #[doc = "Helicopter or multirotor."]
2957 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
2958 #[doc = "Gyroplane."]
2959 MAV_ODID_UA_TYPE_GYROPLANE = 3,
2960 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
2961 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
2962 #[doc = "Ornithopter."]
2963 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
2964 #[doc = "Glider."]
2965 MAV_ODID_UA_TYPE_GLIDER = 6,
2966 #[doc = "Kite."]
2967 MAV_ODID_UA_TYPE_KITE = 7,
2968 #[doc = "Free Balloon."]
2969 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
2970 #[doc = "Captive Balloon."]
2971 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
2972 #[doc = "Airship. E.g. a blimp."]
2973 MAV_ODID_UA_TYPE_AIRSHIP = 10,
2974 #[doc = "Free Fall/Parachute (unpowered)."]
2975 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
2976 #[doc = "Rocket."]
2977 MAV_ODID_UA_TYPE_ROCKET = 12,
2978 #[doc = "Tethered powered aircraft."]
2979 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
2980 #[doc = "Ground Obstacle."]
2981 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
2982 #[doc = "Other type of aircraft not listed earlier."]
2983 MAV_ODID_UA_TYPE_OTHER = 15,
2984}
2985impl MavOdidUaType {
2986 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
2987}
2988impl Default for MavOdidUaType {
2989 fn default() -> Self {
2990 Self::DEFAULT
2991 }
2992}
2993#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2995#[cfg_attr(feature = "serde", serde(tag = "type"))]
2996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2997#[repr(u32)]
2998pub enum MavOdidVerAcc {
2999 #[doc = "The vertical accuracy is unknown."]
3000 MAV_ODID_VER_ACC_UNKNOWN = 0,
3001 #[doc = "The vertical accuracy is smaller than 150 meter."]
3002 MAV_ODID_VER_ACC_150_METER = 1,
3003 #[doc = "The vertical accuracy is smaller than 45 meter."]
3004 MAV_ODID_VER_ACC_45_METER = 2,
3005 #[doc = "The vertical accuracy is smaller than 25 meter."]
3006 MAV_ODID_VER_ACC_25_METER = 3,
3007 #[doc = "The vertical accuracy is smaller than 10 meter."]
3008 MAV_ODID_VER_ACC_10_METER = 4,
3009 #[doc = "The vertical accuracy is smaller than 3 meter."]
3010 MAV_ODID_VER_ACC_3_METER = 5,
3011 #[doc = "The vertical accuracy is smaller than 1 meter."]
3012 MAV_ODID_VER_ACC_1_METER = 6,
3013}
3014impl MavOdidVerAcc {
3015 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3016}
3017impl Default for MavOdidVerAcc {
3018 fn default() -> Self {
3019 Self::DEFAULT
3020 }
3021}
3022#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3023#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3024#[cfg_attr(feature = "serde", serde(tag = "type"))]
3025#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3026#[repr(u32)]
3027#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3028pub enum MavParamExtType {
3029 #[doc = "8-bit unsigned integer"]
3030 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3031 #[doc = "8-bit signed integer"]
3032 MAV_PARAM_EXT_TYPE_INT8 = 2,
3033 #[doc = "16-bit unsigned integer"]
3034 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3035 #[doc = "16-bit signed integer"]
3036 MAV_PARAM_EXT_TYPE_INT16 = 4,
3037 #[doc = "32-bit unsigned integer"]
3038 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3039 #[doc = "32-bit signed integer"]
3040 MAV_PARAM_EXT_TYPE_INT32 = 6,
3041 #[doc = "64-bit unsigned integer"]
3042 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3043 #[doc = "64-bit signed integer"]
3044 MAV_PARAM_EXT_TYPE_INT64 = 8,
3045 #[doc = "32-bit floating-point"]
3046 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3047 #[doc = "64-bit floating-point"]
3048 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3049 #[doc = "Custom Type"]
3050 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3051}
3052impl MavParamExtType {
3053 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3054}
3055impl Default for MavParamExtType {
3056 fn default() -> Self {
3057 Self::DEFAULT
3058 }
3059}
3060#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3062#[cfg_attr(feature = "serde", serde(tag = "type"))]
3063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3064#[repr(u32)]
3065#[doc = "Specifies the datatype of a MAVLink parameter."]
3066pub enum MavParamType {
3067 #[doc = "8-bit unsigned integer"]
3068 MAV_PARAM_TYPE_UINT8 = 1,
3069 #[doc = "8-bit signed integer"]
3070 MAV_PARAM_TYPE_INT8 = 2,
3071 #[doc = "16-bit unsigned integer"]
3072 MAV_PARAM_TYPE_UINT16 = 3,
3073 #[doc = "16-bit signed integer"]
3074 MAV_PARAM_TYPE_INT16 = 4,
3075 #[doc = "32-bit unsigned integer"]
3076 MAV_PARAM_TYPE_UINT32 = 5,
3077 #[doc = "32-bit signed integer"]
3078 MAV_PARAM_TYPE_INT32 = 6,
3079 #[doc = "64-bit unsigned integer"]
3080 MAV_PARAM_TYPE_UINT64 = 7,
3081 #[doc = "64-bit signed integer"]
3082 MAV_PARAM_TYPE_INT64 = 8,
3083 #[doc = "32-bit floating-point"]
3084 MAV_PARAM_TYPE_REAL32 = 9,
3085 #[doc = "64-bit floating-point"]
3086 MAV_PARAM_TYPE_REAL64 = 10,
3087}
3088impl MavParamType {
3089 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3090}
3091impl Default for MavParamType {
3092 fn default() -> Self {
3093 Self::DEFAULT
3094 }
3095}
3096bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3097impl MavPowerStatus {
3098 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3099}
3100impl Default for MavPowerStatus {
3101 fn default() -> Self {
3102 Self::DEFAULT
3103 }
3104}
3105bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3106impl MavProtocolCapability {
3107 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3108}
3109impl Default for MavProtocolCapability {
3110 fn default() -> Self {
3111 Self::DEFAULT
3112 }
3113}
3114#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3116#[cfg_attr(feature = "serde", serde(tag = "type"))]
3117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3118#[repr(u32)]
3119#[doc = "Result from a MAVLink command (MAV_CMD)"]
3120pub enum MavResult {
3121 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3122 MAV_RESULT_ACCEPTED = 0,
3123 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3124 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3125 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3126 MAV_RESULT_DENIED = 2,
3127 #[doc = "Command is not supported (unknown)."]
3128 MAV_RESULT_UNSUPPORTED = 3,
3129 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3130 MAV_RESULT_FAILED = 4,
3131 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3132 MAV_RESULT_IN_PROGRESS = 5,
3133 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3134 MAV_RESULT_CANCELLED = 6,
3135 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3136 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3137 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3138 MAV_RESULT_COMMAND_INT_ONLY = 8,
3139 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3140 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3141}
3142impl MavResult {
3143 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3144}
3145impl Default for MavResult {
3146 fn default() -> Self {
3147 Self::DEFAULT
3148 }
3149}
3150#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3152#[cfg_attr(feature = "serde", serde(tag = "type"))]
3153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3154#[repr(u32)]
3155#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3156pub enum MavRoi {
3157 #[doc = "No region of interest."]
3158 MAV_ROI_NONE = 0,
3159 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3160 MAV_ROI_WPNEXT = 1,
3161 #[doc = "Point toward given waypoint."]
3162 MAV_ROI_WPINDEX = 2,
3163 #[doc = "Point toward fixed location."]
3164 MAV_ROI_LOCATION = 3,
3165 #[doc = "Point toward of given id."]
3166 MAV_ROI_TARGET = 4,
3167}
3168impl MavRoi {
3169 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3170}
3171impl Default for MavRoi {
3172 fn default() -> Self {
3173 Self::DEFAULT
3174 }
3175}
3176#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3178#[cfg_attr(feature = "serde", serde(tag = "type"))]
3179#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3180#[repr(u32)]
3181#[doc = "Enumeration of sensor orientation, according to its rotations"]
3182pub enum MavSensorOrientation {
3183 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3184 MAV_SENSOR_ROTATION_NONE = 0,
3185 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3186 MAV_SENSOR_ROTATION_YAW_45 = 1,
3187 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3188 MAV_SENSOR_ROTATION_YAW_90 = 2,
3189 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3190 MAV_SENSOR_ROTATION_YAW_135 = 3,
3191 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3192 MAV_SENSOR_ROTATION_YAW_180 = 4,
3193 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3194 MAV_SENSOR_ROTATION_YAW_225 = 5,
3195 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3196 MAV_SENSOR_ROTATION_YAW_270 = 6,
3197 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3198 MAV_SENSOR_ROTATION_YAW_315 = 7,
3199 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3200 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3201 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3202 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3203 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3204 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3205 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3206 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3207 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3208 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3209 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3210 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3211 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3212 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3213 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3214 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3215 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3216 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3217 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3218 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3219 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3220 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3221 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3222 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3223 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3224 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3225 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3226 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3227 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3228 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3229 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3230 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3231 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3232 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3233 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3234 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3235 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3236 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3237 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3238 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3239 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3240 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3241 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3242 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3243 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3244 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3245 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3246 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3247 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3248 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3249 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3250 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3251 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3252 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3253 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3254 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3255 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3256 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3257 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3258 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3259 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3260 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3261 #[doc = "Pitch: 315"]
3262 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3263 #[doc = "Roll: 90, Pitch: 315"]
3264 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3265 #[doc = "Custom orientation"]
3266 MAV_SENSOR_ROTATION_CUSTOM = 100,
3267}
3268impl MavSensorOrientation {
3269 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3270}
3271impl Default for MavSensorOrientation {
3272 fn default() -> Self {
3273 Self::DEFAULT
3274 }
3275}
3276#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3278#[cfg_attr(feature = "serde", serde(tag = "type"))]
3279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3280#[repr(u32)]
3281#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3282pub enum MavSeverity {
3283 #[doc = "System is unusable. This is a \"panic\" condition."]
3284 MAV_SEVERITY_EMERGENCY = 0,
3285 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3286 MAV_SEVERITY_ALERT = 1,
3287 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3288 MAV_SEVERITY_CRITICAL = 2,
3289 #[doc = "Indicates an error in secondary/redundant systems."]
3290 MAV_SEVERITY_ERROR = 3,
3291 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3292 MAV_SEVERITY_WARNING = 4,
3293 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3294 MAV_SEVERITY_NOTICE = 5,
3295 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3296 MAV_SEVERITY_INFO = 6,
3297 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3298 MAV_SEVERITY_DEBUG = 7,
3299}
3300impl MavSeverity {
3301 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3302}
3303impl Default for MavSeverity {
3304 fn default() -> Self {
3305 Self::DEFAULT
3306 }
3307}
3308#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3310#[cfg_attr(feature = "serde", serde(tag = "type"))]
3311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3312#[repr(u32)]
3313#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3314pub enum MavStandardMode {
3315 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3316 MAV_STANDARD_MODE_NON_STANDARD = 0,
3317 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3318 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3319 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3320 MAV_STANDARD_MODE_ORBIT = 2,
3321 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3322 MAV_STANDARD_MODE_CRUISE = 3,
3323 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3324 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3325 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3326 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3327 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3328 MAV_STANDARD_MODE_MISSION = 6,
3329 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3330 MAV_STANDARD_MODE_LAND = 7,
3331 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3332 MAV_STANDARD_MODE_TAKEOFF = 8,
3333}
3334impl MavStandardMode {
3335 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3336}
3337impl Default for MavStandardMode {
3338 fn default() -> Self {
3339 Self::DEFAULT
3340 }
3341}
3342#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3344#[cfg_attr(feature = "serde", serde(tag = "type"))]
3345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3346#[repr(u32)]
3347pub enum MavState {
3348 #[doc = "Uninitialized system, state is unknown."]
3349 MAV_STATE_UNINIT = 0,
3350 #[doc = "System is booting up."]
3351 MAV_STATE_BOOT = 1,
3352 #[doc = "System is calibrating and not flight-ready."]
3353 MAV_STATE_CALIBRATING = 2,
3354 #[doc = "System is grounded and on standby. It can be launched any time."]
3355 MAV_STATE_STANDBY = 3,
3356 #[doc = "System is active and might be already airborne. Motors are engaged."]
3357 MAV_STATE_ACTIVE = 4,
3358 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3359 MAV_STATE_CRITICAL = 5,
3360 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3361 MAV_STATE_EMERGENCY = 6,
3362 #[doc = "System just initialized its power-down sequence, will shut down now."]
3363 MAV_STATE_POWEROFF = 7,
3364 #[doc = "System is terminating itself (failsafe or commanded)."]
3365 MAV_STATE_FLIGHT_TERMINATION = 8,
3366}
3367impl MavState {
3368 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3369}
3370impl Default for MavState {
3371 fn default() -> Self {
3372 Self::DEFAULT
3373 }
3374}
3375bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3376impl MavSysStatusSensor {
3377 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3378}
3379impl Default for MavSysStatusSensor {
3380 fn default() -> Self {
3381 Self::DEFAULT
3382 }
3383}
3384bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3385impl MavSysStatusSensorExtended {
3386 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3387}
3388impl Default for MavSysStatusSensorExtended {
3389 fn default() -> Self {
3390 Self::DEFAULT
3391 }
3392}
3393#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3394#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3395#[cfg_attr(feature = "serde", serde(tag = "type"))]
3396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3397#[repr(u32)]
3398pub enum MavTunnelPayloadType {
3399 #[doc = "Encoding of payload unknown."]
3400 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3401 #[doc = "Registered for STorM32 gimbal controller."]
3402 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3403 #[doc = "Registered for STorM32 gimbal controller."]
3404 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3405 #[doc = "Registered for STorM32 gimbal controller."]
3406 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3407 #[doc = "Registered for STorM32 gimbal controller."]
3408 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3409 #[doc = "Registered for STorM32 gimbal controller."]
3410 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3411 #[doc = "Registered for STorM32 gimbal controller."]
3412 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3413 #[doc = "Registered for STorM32 gimbal controller."]
3414 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3415 #[doc = "Registered for STorM32 gimbal controller."]
3416 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3417 #[doc = "Registered for STorM32 gimbal controller."]
3418 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3419 #[doc = "Registered for STorM32 gimbal controller."]
3420 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3421 #[doc = "Registered for ModalAI remote OSD protocol."]
3422 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3423 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3424 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3425 #[doc = "Registered for ModalAI vendor use."]
3426 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3427}
3428impl MavTunnelPayloadType {
3429 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3430}
3431impl Default for MavTunnelPayloadType {
3432 fn default() -> Self {
3433 Self::DEFAULT
3434 }
3435}
3436#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3437#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3438#[cfg_attr(feature = "serde", serde(tag = "type"))]
3439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3440#[repr(u32)]
3441#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3442pub enum MavType {
3443 #[doc = "Generic micro air vehicle"]
3444 MAV_TYPE_GENERIC = 0,
3445 #[doc = "Fixed wing aircraft."]
3446 MAV_TYPE_FIXED_WING = 1,
3447 #[doc = "Quadrotor"]
3448 MAV_TYPE_QUADROTOR = 2,
3449 #[doc = "Coaxial helicopter"]
3450 MAV_TYPE_COAXIAL = 3,
3451 #[doc = "Normal helicopter with tail rotor."]
3452 MAV_TYPE_HELICOPTER = 4,
3453 #[doc = "Ground installation"]
3454 MAV_TYPE_ANTENNA_TRACKER = 5,
3455 #[doc = "Operator control unit / ground control station"]
3456 MAV_TYPE_GCS = 6,
3457 #[doc = "Airship, controlled"]
3458 MAV_TYPE_AIRSHIP = 7,
3459 #[doc = "Free balloon, uncontrolled"]
3460 MAV_TYPE_FREE_BALLOON = 8,
3461 #[doc = "Rocket"]
3462 MAV_TYPE_ROCKET = 9,
3463 #[doc = "Ground rover"]
3464 MAV_TYPE_GROUND_ROVER = 10,
3465 #[doc = "Surface vessel, boat, ship"]
3466 MAV_TYPE_SURFACE_BOAT = 11,
3467 #[doc = "Submarine"]
3468 MAV_TYPE_SUBMARINE = 12,
3469 #[doc = "Hexarotor"]
3470 MAV_TYPE_HEXAROTOR = 13,
3471 #[doc = "Octorotor"]
3472 MAV_TYPE_OCTOROTOR = 14,
3473 #[doc = "Tricopter"]
3474 MAV_TYPE_TRICOPTER = 15,
3475 #[doc = "Flapping wing"]
3476 MAV_TYPE_FLAPPING_WING = 16,
3477 #[doc = "Kite"]
3478 MAV_TYPE_KITE = 17,
3479 #[doc = "Onboard companion controller"]
3480 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3481 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3482 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3483 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3484 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3485 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3486 MAV_TYPE_VTOL_TILTROTOR = 21,
3487 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3488 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3489 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3490 MAV_TYPE_VTOL_TAILSITTER = 23,
3491 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3492 MAV_TYPE_VTOL_TILTWING = 24,
3493 #[doc = "VTOL reserved 5"]
3494 MAV_TYPE_VTOL_RESERVED5 = 25,
3495 #[doc = "Gimbal"]
3496 MAV_TYPE_GIMBAL = 26,
3497 #[doc = "ADSB system"]
3498 MAV_TYPE_ADSB = 27,
3499 #[doc = "Steerable, nonrigid airfoil"]
3500 MAV_TYPE_PARAFOIL = 28,
3501 #[doc = "Dodecarotor"]
3502 MAV_TYPE_DODECAROTOR = 29,
3503 #[doc = "Camera"]
3504 MAV_TYPE_CAMERA = 30,
3505 #[doc = "Charging station"]
3506 MAV_TYPE_CHARGING_STATION = 31,
3507 #[doc = "FLARM collision avoidance system"]
3508 MAV_TYPE_FLARM = 32,
3509 #[doc = "Servo"]
3510 MAV_TYPE_SERVO = 33,
3511 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3512 MAV_TYPE_ODID = 34,
3513 #[doc = "Decarotor"]
3514 MAV_TYPE_DECAROTOR = 35,
3515 #[doc = "Battery"]
3516 MAV_TYPE_BATTERY = 36,
3517 #[doc = "Parachute"]
3518 MAV_TYPE_PARACHUTE = 37,
3519 #[doc = "Log"]
3520 MAV_TYPE_LOG = 38,
3521 #[doc = "OSD"]
3522 MAV_TYPE_OSD = 39,
3523 #[doc = "IMU"]
3524 MAV_TYPE_IMU = 40,
3525 #[doc = "GPS"]
3526 MAV_TYPE_GPS = 41,
3527 #[doc = "Winch"]
3528 MAV_TYPE_WINCH = 42,
3529 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3530 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3531 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3532 MAV_TYPE_ILLUMINATOR = 44,
3533 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3534 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3535}
3536impl MavType {
3537 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3538}
3539impl Default for MavType {
3540 fn default() -> Self {
3541 Self::DEFAULT
3542 }
3543}
3544#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3546#[cfg_attr(feature = "serde", serde(tag = "type"))]
3547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3548#[repr(u32)]
3549#[doc = "Enumeration of VTOL states"]
3550pub enum MavVtolState {
3551 #[doc = "MAV is not configured as VTOL"]
3552 MAV_VTOL_STATE_UNDEFINED = 0,
3553 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3554 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3555 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3556 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3557 #[doc = "VTOL is in multicopter state"]
3558 MAV_VTOL_STATE_MC = 3,
3559 #[doc = "VTOL is in fixed-wing state"]
3560 MAV_VTOL_STATE_FW = 4,
3561}
3562impl MavVtolState {
3563 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3564}
3565impl Default for MavVtolState {
3566 fn default() -> Self {
3567 Self::DEFAULT
3568 }
3569}
3570bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3571impl MavWinchStatusFlag {
3572 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3573}
3574impl Default for MavWinchStatusFlag {
3575 fn default() -> Self {
3576 Self::DEFAULT
3577 }
3578}
3579#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3581#[cfg_attr(feature = "serde", serde(tag = "type"))]
3582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3583#[repr(u32)]
3584pub enum MavlinkDataStreamType {
3585 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3586 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3587 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3588 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3589 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3590 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3591}
3592impl MavlinkDataStreamType {
3593 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3594}
3595impl Default for MavlinkDataStreamType {
3596 fn default() -> Self {
3597 Self::DEFAULT
3598 }
3599}
3600#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3602#[cfg_attr(feature = "serde", serde(tag = "type"))]
3603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3604#[repr(u32)]
3605#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3606pub enum MissionState {
3607 #[doc = "The mission status reporting is not supported."]
3608 MISSION_STATE_UNKNOWN = 0,
3609 #[doc = "No mission on the vehicle."]
3610 MISSION_STATE_NO_MISSION = 1,
3611 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3612 MISSION_STATE_NOT_STARTED = 2,
3613 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3614 MISSION_STATE_ACTIVE = 3,
3615 #[doc = "Mission is paused when in auto mode."]
3616 MISSION_STATE_PAUSED = 4,
3617 #[doc = "Mission has executed all mission items."]
3618 MISSION_STATE_COMPLETE = 5,
3619}
3620impl MissionState {
3621 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3622}
3623impl Default for MissionState {
3624 fn default() -> Self {
3625 Self::DEFAULT
3626 }
3627}
3628#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3629#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3630#[cfg_attr(feature = "serde", serde(tag = "type"))]
3631#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3632#[repr(u32)]
3633#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3634pub enum MotorTestOrder {
3635 #[doc = "Default autopilot motor test method."]
3636 MOTOR_TEST_ORDER_DEFAULT = 0,
3637 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3638 MOTOR_TEST_ORDER_SEQUENCE = 1,
3639 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3640 MOTOR_TEST_ORDER_BOARD = 2,
3641}
3642impl MotorTestOrder {
3643 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3644}
3645impl Default for MotorTestOrder {
3646 fn default() -> Self {
3647 Self::DEFAULT
3648 }
3649}
3650#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3652#[cfg_attr(feature = "serde", serde(tag = "type"))]
3653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3654#[repr(u32)]
3655#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3656pub enum MotorTestThrottleType {
3657 #[doc = "Throttle as a percentage (0 ~ 100)"]
3658 MOTOR_TEST_THROTTLE_PERCENT = 0,
3659 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3660 MOTOR_TEST_THROTTLE_PWM = 1,
3661 #[doc = "Throttle pass-through from pilot's transmitter."]
3662 MOTOR_TEST_THROTTLE_PILOT = 2,
3663 #[doc = "Per-motor compass calibration test."]
3664 MOTOR_TEST_COMPASS_CAL = 3,
3665}
3666impl MotorTestThrottleType {
3667 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3668}
3669impl Default for MotorTestThrottleType {
3670 fn default() -> Self {
3671 Self::DEFAULT
3672 }
3673}
3674#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3675#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3676#[cfg_attr(feature = "serde", serde(tag = "type"))]
3677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3678#[repr(u32)]
3679pub enum NavVtolLandOptions {
3680 #[doc = "Default autopilot landing behaviour."]
3681 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3682 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3683 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3684 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3685 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3686}
3687impl NavVtolLandOptions {
3688 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3689}
3690impl Default for NavVtolLandOptions {
3691 fn default() -> Self {
3692 Self::DEFAULT
3693 }
3694}
3695#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3697#[cfg_attr(feature = "serde", serde(tag = "type"))]
3698#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3699#[repr(u32)]
3700#[doc = "Yaw behaviour during orbit flight."]
3701pub enum OrbitYawBehaviour {
3702 #[doc = "Vehicle front points to the center (default)."]
3703 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3704 #[doc = "Vehicle front holds heading when message received."]
3705 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3706 #[doc = "Yaw uncontrolled."]
3707 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3708 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3709 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3710 #[doc = "Yaw controlled by RC input."]
3711 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3712 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3713 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3714}
3715impl OrbitYawBehaviour {
3716 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3717}
3718impl Default for OrbitYawBehaviour {
3719 fn default() -> Self {
3720 Self::DEFAULT
3721 }
3722}
3723#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3724#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3725#[cfg_attr(feature = "serde", serde(tag = "type"))]
3726#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3727#[repr(u32)]
3728#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3729pub enum ParachuteAction {
3730 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3731 PARACHUTE_DISABLE = 0,
3732 #[doc = "Enable auto-release of parachute."]
3733 PARACHUTE_ENABLE = 1,
3734 #[doc = "Release parachute and kill motors."]
3735 PARACHUTE_RELEASE = 2,
3736}
3737impl ParachuteAction {
3738 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3739}
3740impl Default for ParachuteAction {
3741 fn default() -> Self {
3742 Self::DEFAULT
3743 }
3744}
3745#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3747#[cfg_attr(feature = "serde", serde(tag = "type"))]
3748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3749#[repr(u32)]
3750#[doc = "Result from PARAM_EXT_SET message."]
3751pub enum ParamAck {
3752 #[doc = "Parameter value ACCEPTED and SET"]
3753 PARAM_ACK_ACCEPTED = 0,
3754 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3755 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3756 #[doc = "Parameter failed to set"]
3757 PARAM_ACK_FAILED = 2,
3758 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3759 PARAM_ACK_IN_PROGRESS = 3,
3760}
3761impl ParamAck {
3762 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3763}
3764impl Default for ParamAck {
3765 fn default() -> Self {
3766 Self::DEFAULT
3767 }
3768}
3769bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3770impl PositionTargetTypemask {
3771 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3772}
3773impl Default for PositionTargetTypemask {
3774 fn default() -> Self {
3775 Self::DEFAULT
3776 }
3777}
3778#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3780#[cfg_attr(feature = "serde", serde(tag = "type"))]
3781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3782#[repr(u32)]
3783#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3784pub enum PrecisionLandMode {
3785 #[doc = "Normal (non-precision) landing."]
3786 PRECISION_LAND_MODE_DISABLED = 0,
3787 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3788 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3789 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3790 PRECISION_LAND_MODE_REQUIRED = 2,
3791}
3792impl PrecisionLandMode {
3793 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3794}
3795impl Default for PrecisionLandMode {
3796 fn default() -> Self {
3797 Self::DEFAULT
3798 }
3799}
3800#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3802#[cfg_attr(feature = "serde", serde(tag = "type"))]
3803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3804#[repr(u32)]
3805#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3806pub enum PreflightStorageMissionAction {
3807 #[doc = "Read current mission data from persistent storage"]
3808 MISSION_READ_PERSISTENT = 0,
3809 #[doc = "Write current mission data to persistent storage"]
3810 MISSION_WRITE_PERSISTENT = 1,
3811 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3812 MISSION_RESET_DEFAULT = 2,
3813}
3814impl PreflightStorageMissionAction {
3815 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3816}
3817impl Default for PreflightStorageMissionAction {
3818 fn default() -> Self {
3819 Self::DEFAULT
3820 }
3821}
3822#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3824#[cfg_attr(feature = "serde", serde(tag = "type"))]
3825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3826#[repr(u32)]
3827#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3828pub enum PreflightStorageParameterAction {
3829 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3830 PARAM_READ_PERSISTENT = 0,
3831 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3832 PARAM_WRITE_PERSISTENT = 1,
3833 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3834 PARAM_RESET_CONFIG_DEFAULT = 2,
3835 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3836 PARAM_RESET_SENSOR_DEFAULT = 3,
3837 #[doc = "Reset all parameters, including operation counters, to default values"]
3838 PARAM_RESET_ALL_DEFAULT = 4,
3839}
3840impl PreflightStorageParameterAction {
3841 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3842}
3843impl Default for PreflightStorageParameterAction {
3844 fn default() -> Self {
3845 Self::DEFAULT
3846 }
3847}
3848#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3849#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3850#[cfg_attr(feature = "serde", serde(tag = "type"))]
3851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3852#[repr(u32)]
3853#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3854pub enum RcSubType {
3855 #[doc = "Spektrum DSM2"]
3856 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3857 #[doc = "Spektrum DSMX"]
3858 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3859 #[doc = "Spektrum DSMX8"]
3860 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3861}
3862impl RcSubType {
3863 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3864}
3865impl Default for RcSubType {
3866 fn default() -> Self {
3867 Self::DEFAULT
3868 }
3869}
3870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3872#[cfg_attr(feature = "serde", serde(tag = "type"))]
3873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3874#[repr(u32)]
3875#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3876pub enum RcType {
3877 #[doc = "Spektrum"]
3878 RC_TYPE_SPEKTRUM = 0,
3879 #[doc = "CRSF"]
3880 RC_TYPE_CRSF = 1,
3881}
3882impl RcType {
3883 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3884}
3885impl Default for RcType {
3886 fn default() -> Self {
3887 Self::DEFAULT
3888 }
3889}
3890#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3892#[cfg_attr(feature = "serde", serde(tag = "type"))]
3893#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3894#[repr(u32)]
3895#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3896pub enum RebootShutdownConditions {
3897 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3898 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3899 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3900 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3901}
3902impl RebootShutdownConditions {
3903 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3904}
3905impl Default for RebootShutdownConditions {
3906 fn default() -> Self {
3907 Self::DEFAULT
3908 }
3909}
3910#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3911#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3912#[cfg_attr(feature = "serde", serde(tag = "type"))]
3913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3914#[repr(u32)]
3915#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
3916pub enum RtkBaselineCoordinateSystem {
3917 #[doc = "Earth-centered, Earth-fixed"]
3918 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
3919 #[doc = "RTK basestation centered, north, east, down"]
3920 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
3921}
3922impl RtkBaselineCoordinateSystem {
3923 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
3924}
3925impl Default for RtkBaselineCoordinateSystem {
3926 fn default() -> Self {
3927 Self::DEFAULT
3928 }
3929}
3930#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3932#[cfg_attr(feature = "serde", serde(tag = "type"))]
3933#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3934#[repr(u32)]
3935#[doc = "Possible safety switch states."]
3936pub enum SafetySwitchState {
3937 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
3938 SAFETY_SWITCH_STATE_SAFE = 0,
3939 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
3940 SAFETY_SWITCH_STATE_DANGEROUS = 1,
3941}
3942impl SafetySwitchState {
3943 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
3944}
3945impl Default for SafetySwitchState {
3946 fn default() -> Self {
3947 Self::DEFAULT
3948 }
3949}
3950#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3952#[cfg_attr(feature = "serde", serde(tag = "type"))]
3953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3954#[repr(u32)]
3955#[doc = "SERIAL_CONTROL device types"]
3956pub enum SerialControlDev {
3957 #[doc = "First telemetry port"]
3958 SERIAL_CONTROL_DEV_TELEM1 = 0,
3959 #[doc = "Second telemetry port"]
3960 SERIAL_CONTROL_DEV_TELEM2 = 1,
3961 #[doc = "First GPS port"]
3962 SERIAL_CONTROL_DEV_GPS1 = 2,
3963 #[doc = "Second GPS port"]
3964 SERIAL_CONTROL_DEV_GPS2 = 3,
3965 #[doc = "system shell"]
3966 SERIAL_CONTROL_DEV_SHELL = 10,
3967 #[doc = "SERIAL0"]
3968 SERIAL_CONTROL_SERIAL0 = 100,
3969 #[doc = "SERIAL1"]
3970 SERIAL_CONTROL_SERIAL1 = 101,
3971 #[doc = "SERIAL2"]
3972 SERIAL_CONTROL_SERIAL2 = 102,
3973 #[doc = "SERIAL3"]
3974 SERIAL_CONTROL_SERIAL3 = 103,
3975 #[doc = "SERIAL4"]
3976 SERIAL_CONTROL_SERIAL4 = 104,
3977 #[doc = "SERIAL5"]
3978 SERIAL_CONTROL_SERIAL5 = 105,
3979 #[doc = "SERIAL6"]
3980 SERIAL_CONTROL_SERIAL6 = 106,
3981 #[doc = "SERIAL7"]
3982 SERIAL_CONTROL_SERIAL7 = 107,
3983 #[doc = "SERIAL8"]
3984 SERIAL_CONTROL_SERIAL8 = 108,
3985 #[doc = "SERIAL9"]
3986 SERIAL_CONTROL_SERIAL9 = 109,
3987}
3988impl SerialControlDev {
3989 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
3990}
3991impl Default for SerialControlDev {
3992 fn default() -> Self {
3993 Self::DEFAULT
3994 }
3995}
3996bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
3997impl SerialControlFlag {
3998 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
3999}
4000impl Default for SerialControlFlag {
4001 fn default() -> Self {
4002 Self::DEFAULT
4003 }
4004}
4005#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4007#[cfg_attr(feature = "serde", serde(tag = "type"))]
4008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4009#[repr(u32)]
4010#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4011pub enum SetFocusType {
4012 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4013 FOCUS_TYPE_STEP = 0,
4014 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4015 FOCUS_TYPE_CONTINUOUS = 1,
4016 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4017 FOCUS_TYPE_RANGE = 2,
4018 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4019 FOCUS_TYPE_METERS = 3,
4020 #[doc = "Focus automatically."]
4021 FOCUS_TYPE_AUTO = 4,
4022 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4023 FOCUS_TYPE_AUTO_SINGLE = 5,
4024 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4025 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4026}
4027impl SetFocusType {
4028 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4029}
4030impl Default for SetFocusType {
4031 fn default() -> Self {
4032 Self::DEFAULT
4033 }
4034}
4035#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4037#[cfg_attr(feature = "serde", serde(tag = "type"))]
4038#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4039#[repr(u32)]
4040#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4041pub enum SpeedType {
4042 #[doc = "Airspeed"]
4043 SPEED_TYPE_AIRSPEED = 0,
4044 #[doc = "Groundspeed"]
4045 SPEED_TYPE_GROUNDSPEED = 1,
4046 #[doc = "Climb speed"]
4047 SPEED_TYPE_CLIMB_SPEED = 2,
4048 #[doc = "Descent speed"]
4049 SPEED_TYPE_DESCENT_SPEED = 3,
4050}
4051impl SpeedType {
4052 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4053}
4054impl Default for SpeedType {
4055 fn default() -> Self {
4056 Self::DEFAULT
4057 }
4058}
4059#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4060#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4061#[cfg_attr(feature = "serde", serde(tag = "type"))]
4062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4063#[repr(u32)]
4064#[doc = "Flags to indicate the status of camera storage."]
4065pub enum StorageStatus {
4066 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4067 STORAGE_STATUS_EMPTY = 0,
4068 #[doc = "Storage present but unformatted."]
4069 STORAGE_STATUS_UNFORMATTED = 1,
4070 #[doc = "Storage present and ready."]
4071 STORAGE_STATUS_READY = 2,
4072 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4073 STORAGE_STATUS_NOT_SUPPORTED = 3,
4074}
4075impl StorageStatus {
4076 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4077}
4078impl Default for StorageStatus {
4079 fn default() -> Self {
4080 Self::DEFAULT
4081 }
4082}
4083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4085#[cfg_attr(feature = "serde", serde(tag = "type"))]
4086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4087#[repr(u32)]
4088#[doc = "Flags to indicate the type of storage."]
4089pub enum StorageType {
4090 #[doc = "Storage type is not known."]
4091 STORAGE_TYPE_UNKNOWN = 0,
4092 #[doc = "Storage type is USB device."]
4093 STORAGE_TYPE_USB_STICK = 1,
4094 #[doc = "Storage type is SD card."]
4095 STORAGE_TYPE_SD = 2,
4096 #[doc = "Storage type is microSD card."]
4097 STORAGE_TYPE_MICROSD = 3,
4098 #[doc = "Storage type is CFast."]
4099 STORAGE_TYPE_CF = 4,
4100 #[doc = "Storage type is CFexpress."]
4101 STORAGE_TYPE_CFE = 5,
4102 #[doc = "Storage type is XQD."]
4103 STORAGE_TYPE_XQD = 6,
4104 #[doc = "Storage type is HD mass storage type."]
4105 STORAGE_TYPE_HD = 7,
4106 #[doc = "Storage type is other, not listed type."]
4107 STORAGE_TYPE_OTHER = 254,
4108}
4109impl StorageType {
4110 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4111}
4112impl Default for StorageType {
4113 fn default() -> Self {
4114 Self::DEFAULT
4115 }
4116}
4117bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4118impl StorageUsageFlag {
4119 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4120}
4121impl Default for StorageUsageFlag {
4122 fn default() -> Self {
4123 Self::DEFAULT
4124 }
4125}
4126#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4127#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4128#[cfg_attr(feature = "serde", serde(tag = "type"))]
4129#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4130#[repr(u32)]
4131#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4132pub enum TuneFormat {
4133 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4134 TUNE_FORMAT_QBASIC1_1 = 1,
4135 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4136 TUNE_FORMAT_MML_MODERN = 2,
4137}
4138impl TuneFormat {
4139 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4140}
4141impl Default for TuneFormat {
4142 fn default() -> Self {
4143 Self::DEFAULT
4144 }
4145}
4146#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4148#[cfg_attr(feature = "serde", serde(tag = "type"))]
4149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4150#[repr(u32)]
4151#[doc = "Generalized UAVCAN node health"]
4152pub enum UavcanNodeHealth {
4153 #[doc = "The node is functioning properly."]
4154 UAVCAN_NODE_HEALTH_OK = 0,
4155 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4156 UAVCAN_NODE_HEALTH_WARNING = 1,
4157 #[doc = "The node has encountered a major failure."]
4158 UAVCAN_NODE_HEALTH_ERROR = 2,
4159 #[doc = "The node has suffered a fatal malfunction."]
4160 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4161}
4162impl UavcanNodeHealth {
4163 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4164}
4165impl Default for UavcanNodeHealth {
4166 fn default() -> Self {
4167 Self::DEFAULT
4168 }
4169}
4170#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4172#[cfg_attr(feature = "serde", serde(tag = "type"))]
4173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4174#[repr(u32)]
4175#[doc = "Generalized UAVCAN node mode"]
4176pub enum UavcanNodeMode {
4177 #[doc = "The node is performing its primary functions."]
4178 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4179 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4180 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4181 #[doc = "The node is under maintenance."]
4182 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4183 #[doc = "The node is in the process of updating its software."]
4184 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4185 #[doc = "The node is no longer available online."]
4186 UAVCAN_NODE_MODE_OFFLINE = 7,
4187}
4188impl UavcanNodeMode {
4189 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4190}
4191impl Default for UavcanNodeMode {
4192 fn default() -> Self {
4193 Self::DEFAULT
4194 }
4195}
4196bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4197impl UtmDataAvailFlags {
4198 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4199}
4200impl Default for UtmDataAvailFlags {
4201 fn default() -> Self {
4202 Self::DEFAULT
4203 }
4204}
4205#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4207#[cfg_attr(feature = "serde", serde(tag = "type"))]
4208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4209#[repr(u32)]
4210#[doc = "Airborne status of UAS."]
4211pub enum UtmFlightState {
4212 #[doc = "The flight state can't be determined."]
4213 UTM_FLIGHT_STATE_UNKNOWN = 1,
4214 #[doc = "UAS on ground."]
4215 UTM_FLIGHT_STATE_GROUND = 2,
4216 #[doc = "UAS airborne."]
4217 UTM_FLIGHT_STATE_AIRBORNE = 3,
4218 #[doc = "UAS is in an emergency flight state."]
4219 UTM_FLIGHT_STATE_EMERGENCY = 16,
4220 #[doc = "UAS has no active controls."]
4221 UTM_FLIGHT_STATE_NOCTRL = 32,
4222}
4223impl UtmFlightState {
4224 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4225}
4226impl Default for UtmFlightState {
4227 fn default() -> Self {
4228 Self::DEFAULT
4229 }
4230}
4231#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4233#[cfg_attr(feature = "serde", serde(tag = "type"))]
4234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4235#[repr(u32)]
4236#[doc = "Video stream encodings"]
4237pub enum VideoStreamEncoding {
4238 #[doc = "Stream encoding is unknown"]
4239 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4240 #[doc = "Stream encoding is H.264"]
4241 VIDEO_STREAM_ENCODING_H264 = 1,
4242 #[doc = "Stream encoding is H.265"]
4243 VIDEO_STREAM_ENCODING_H265 = 2,
4244}
4245impl VideoStreamEncoding {
4246 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4247}
4248impl Default for VideoStreamEncoding {
4249 fn default() -> Self {
4250 Self::DEFAULT
4251 }
4252}
4253bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4254impl VideoStreamStatusFlags {
4255 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4256}
4257impl Default for VideoStreamStatusFlags {
4258 fn default() -> Self {
4259 Self::DEFAULT
4260 }
4261}
4262#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4264#[cfg_attr(feature = "serde", serde(tag = "type"))]
4265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4266#[repr(u32)]
4267#[doc = "Video stream types"]
4268pub enum VideoStreamType {
4269 #[doc = "Stream is RTSP"]
4270 VIDEO_STREAM_TYPE_RTSP = 0,
4271 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4272 VIDEO_STREAM_TYPE_RTPUDP = 1,
4273 #[doc = "Stream is MPEG on TCP"]
4274 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4275 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4276 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4277}
4278impl VideoStreamType {
4279 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4280}
4281impl Default for VideoStreamType {
4282 fn default() -> Self {
4283 Self::DEFAULT
4284 }
4285}
4286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4288#[cfg_attr(feature = "serde", serde(tag = "type"))]
4289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4290#[repr(u32)]
4291#[doc = "Direction of VTOL transition"]
4292pub enum VtolTransitionHeading {
4293 #[doc = "Respect the heading configuration of the vehicle."]
4294 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4295 #[doc = "Use the heading pointing towards the next waypoint."]
4296 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4297 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4298 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4299 #[doc = "Use the specified heading in parameter 4."]
4300 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4301 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4302 VTOL_TRANSITION_HEADING_ANY = 4,
4303}
4304impl VtolTransitionHeading {
4305 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4306}
4307impl Default for VtolTransitionHeading {
4308 fn default() -> Self {
4309 Self::DEFAULT
4310 }
4311}
4312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4314#[cfg_attr(feature = "serde", serde(tag = "type"))]
4315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4316#[repr(u32)]
4317#[doc = "WiFi Mode."]
4318pub enum WifiConfigApMode {
4319 #[doc = "WiFi mode is undefined."]
4320 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4321 #[doc = "WiFi configured as an access point."]
4322 WIFI_CONFIG_AP_MODE_AP = 1,
4323 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4324 WIFI_CONFIG_AP_MODE_STATION = 2,
4325 #[doc = "WiFi disabled."]
4326 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4327}
4328impl WifiConfigApMode {
4329 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4330}
4331impl Default for WifiConfigApMode {
4332 fn default() -> Self {
4333 Self::DEFAULT
4334 }
4335}
4336#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4338#[cfg_attr(feature = "serde", serde(tag = "type"))]
4339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4340#[repr(u32)]
4341#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4342pub enum WifiConfigApResponse {
4343 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4344 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4345 #[doc = "Changes accepted."]
4346 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4347 #[doc = "Changes rejected."]
4348 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4349 #[doc = "Invalid Mode."]
4350 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4351 #[doc = "Invalid SSID."]
4352 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4353 #[doc = "Invalid Password."]
4354 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4355}
4356impl WifiConfigApResponse {
4357 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4358}
4359impl Default for WifiConfigApResponse {
4360 fn default() -> Self {
4361 Self::DEFAULT
4362 }
4363}
4364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4366#[cfg_attr(feature = "serde", serde(tag = "type"))]
4367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4368#[repr(u32)]
4369#[doc = "Winch actions."]
4370pub enum WinchActions {
4371 #[doc = "Allow motor to freewheel."]
4372 WINCH_RELAXED = 0,
4373 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4374 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4375 #[doc = "Wind or unwind line at specified rate."]
4376 WINCH_RATE_CONTROL = 2,
4377 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4378 WINCH_LOCK = 3,
4379 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4380 WINCH_DELIVER = 4,
4381 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4382 WINCH_HOLD = 5,
4383 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4384 WINCH_RETRACT = 6,
4385 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4386 WINCH_LOAD_LINE = 7,
4387 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4388 WINCH_ABANDON_LINE = 8,
4389 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4390 WINCH_LOAD_PAYLOAD = 9,
4391}
4392impl WinchActions {
4393 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4394}
4395impl Default for WinchActions {
4396 fn default() -> Self {
4397 Self::DEFAULT
4398 }
4399}
4400#[doc = "id: 140"]
4401#[doc = "Set the vehicle attitude and body angular rates."]
4402#[derive(Debug, Clone, PartialEq)]
4403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4404#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4405pub struct ACTUATOR_CONTROL_TARGET_DATA {
4406 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4407 pub time_usec: u64,
4408 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4409 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4410 pub controls: [f32; 8],
4411 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4412 pub group_mlx: u8,
4413}
4414impl ACTUATOR_CONTROL_TARGET_DATA {
4415 pub const ENCODED_LEN: usize = 41usize;
4416 pub const DEFAULT: Self = Self {
4417 time_usec: 0_u64,
4418 controls: [0.0_f32; 8usize],
4419 group_mlx: 0_u8,
4420 };
4421 #[cfg(feature = "arbitrary")]
4422 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4423 use arbitrary::{Arbitrary, Unstructured};
4424 let mut buf = [0u8; 1024];
4425 rng.fill_bytes(&mut buf);
4426 let mut unstructured = Unstructured::new(&buf);
4427 Self::arbitrary(&mut unstructured).unwrap_or_default()
4428 }
4429}
4430impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4431 fn default() -> Self {
4432 Self::DEFAULT.clone()
4433 }
4434}
4435impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4436 type Message = MavMessage;
4437 const ID: u32 = 140u32;
4438 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4439 const EXTRA_CRC: u8 = 181u8;
4440 const ENCODED_LEN: usize = 41usize;
4441 fn deser(
4442 _version: MavlinkVersion,
4443 __input: &[u8],
4444 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4445 let avail_len = __input.len();
4446 let mut payload_buf = [0; Self::ENCODED_LEN];
4447 let mut buf = if avail_len < Self::ENCODED_LEN {
4448 payload_buf[0..avail_len].copy_from_slice(__input);
4449 Bytes::new(&payload_buf)
4450 } else {
4451 Bytes::new(__input)
4452 };
4453 let mut __struct = Self::default();
4454 __struct.time_usec = buf.get_u64_le();
4455 for v in &mut __struct.controls {
4456 let val = buf.get_f32_le();
4457 *v = val;
4458 }
4459 __struct.group_mlx = buf.get_u8();
4460 Ok(__struct)
4461 }
4462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4463 let mut __tmp = BytesMut::new(bytes);
4464 #[allow(clippy::absurd_extreme_comparisons)]
4465 #[allow(unused_comparisons)]
4466 if __tmp.remaining() < Self::ENCODED_LEN {
4467 panic!(
4468 "buffer is too small (need {} bytes, but got {})",
4469 Self::ENCODED_LEN,
4470 __tmp.remaining(),
4471 )
4472 }
4473 __tmp.put_u64_le(self.time_usec);
4474 for val in &self.controls {
4475 __tmp.put_f32_le(*val);
4476 }
4477 __tmp.put_u8(self.group_mlx);
4478 if matches!(version, MavlinkVersion::V2) {
4479 let len = __tmp.len();
4480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4481 } else {
4482 __tmp.len()
4483 }
4484 }
4485}
4486#[doc = "id: 375"]
4487#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4488#[derive(Debug, Clone, PartialEq)]
4489#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4490#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4491pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4492 #[doc = "Timestamp (since system boot)."]
4493 pub time_usec: u64,
4494 #[doc = "Active outputs"]
4495 pub active: u32,
4496 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4497 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4498 pub actuator: [f32; 32],
4499}
4500impl ACTUATOR_OUTPUT_STATUS_DATA {
4501 pub const ENCODED_LEN: usize = 140usize;
4502 pub const DEFAULT: Self = Self {
4503 time_usec: 0_u64,
4504 active: 0_u32,
4505 actuator: [0.0_f32; 32usize],
4506 };
4507 #[cfg(feature = "arbitrary")]
4508 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4509 use arbitrary::{Arbitrary, Unstructured};
4510 let mut buf = [0u8; 1024];
4511 rng.fill_bytes(&mut buf);
4512 let mut unstructured = Unstructured::new(&buf);
4513 Self::arbitrary(&mut unstructured).unwrap_or_default()
4514 }
4515}
4516impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4517 fn default() -> Self {
4518 Self::DEFAULT.clone()
4519 }
4520}
4521impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4522 type Message = MavMessage;
4523 const ID: u32 = 375u32;
4524 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4525 const EXTRA_CRC: u8 = 251u8;
4526 const ENCODED_LEN: usize = 140usize;
4527 fn deser(
4528 _version: MavlinkVersion,
4529 __input: &[u8],
4530 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4531 let avail_len = __input.len();
4532 let mut payload_buf = [0; Self::ENCODED_LEN];
4533 let mut buf = if avail_len < Self::ENCODED_LEN {
4534 payload_buf[0..avail_len].copy_from_slice(__input);
4535 Bytes::new(&payload_buf)
4536 } else {
4537 Bytes::new(__input)
4538 };
4539 let mut __struct = Self::default();
4540 __struct.time_usec = buf.get_u64_le();
4541 __struct.active = buf.get_u32_le();
4542 for v in &mut __struct.actuator {
4543 let val = buf.get_f32_le();
4544 *v = val;
4545 }
4546 Ok(__struct)
4547 }
4548 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4549 let mut __tmp = BytesMut::new(bytes);
4550 #[allow(clippy::absurd_extreme_comparisons)]
4551 #[allow(unused_comparisons)]
4552 if __tmp.remaining() < Self::ENCODED_LEN {
4553 panic!(
4554 "buffer is too small (need {} bytes, but got {})",
4555 Self::ENCODED_LEN,
4556 __tmp.remaining(),
4557 )
4558 }
4559 __tmp.put_u64_le(self.time_usec);
4560 __tmp.put_u32_le(self.active);
4561 for val in &self.actuator {
4562 __tmp.put_f32_le(*val);
4563 }
4564 if matches!(version, MavlinkVersion::V2) {
4565 let len = __tmp.len();
4566 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4567 } else {
4568 __tmp.len()
4569 }
4570 }
4571}
4572#[doc = "id: 246"]
4573#[doc = "The location and information of an ADSB vehicle."]
4574#[derive(Debug, Clone, PartialEq)]
4575#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4576#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4577pub struct ADSB_VEHICLE_DATA {
4578 #[doc = "ICAO address"]
4579 pub ICAO_address: u32,
4580 #[doc = "Latitude"]
4581 pub lat: i32,
4582 #[doc = "Longitude"]
4583 pub lon: i32,
4584 #[doc = "Altitude(ASL)"]
4585 pub altitude: i32,
4586 #[doc = "Course over ground"]
4587 pub heading: u16,
4588 #[doc = "The horizontal velocity"]
4589 pub hor_velocity: u16,
4590 #[doc = "The vertical velocity. Positive is up"]
4591 pub ver_velocity: i16,
4592 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4593 pub flags: AdsbFlags,
4594 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4595 pub squawk: u16,
4596 #[doc = "ADSB altitude type."]
4597 pub altitude_type: AdsbAltitudeType,
4598 #[doc = "The callsign, 8+null"]
4599 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4600 pub callsign: [u8; 9],
4601 #[doc = "ADSB emitter type."]
4602 pub emitter_type: AdsbEmitterType,
4603 #[doc = "Time since last communication in seconds"]
4604 pub tslc: u8,
4605}
4606impl ADSB_VEHICLE_DATA {
4607 pub const ENCODED_LEN: usize = 38usize;
4608 pub const DEFAULT: Self = Self {
4609 ICAO_address: 0_u32,
4610 lat: 0_i32,
4611 lon: 0_i32,
4612 altitude: 0_i32,
4613 heading: 0_u16,
4614 hor_velocity: 0_u16,
4615 ver_velocity: 0_i16,
4616 flags: AdsbFlags::DEFAULT,
4617 squawk: 0_u16,
4618 altitude_type: AdsbAltitudeType::DEFAULT,
4619 callsign: [0_u8; 9usize],
4620 emitter_type: AdsbEmitterType::DEFAULT,
4621 tslc: 0_u8,
4622 };
4623 #[cfg(feature = "arbitrary")]
4624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4625 use arbitrary::{Arbitrary, Unstructured};
4626 let mut buf = [0u8; 1024];
4627 rng.fill_bytes(&mut buf);
4628 let mut unstructured = Unstructured::new(&buf);
4629 Self::arbitrary(&mut unstructured).unwrap_or_default()
4630 }
4631}
4632impl Default for ADSB_VEHICLE_DATA {
4633 fn default() -> Self {
4634 Self::DEFAULT.clone()
4635 }
4636}
4637impl MessageData for ADSB_VEHICLE_DATA {
4638 type Message = MavMessage;
4639 const ID: u32 = 246u32;
4640 const NAME: &'static str = "ADSB_VEHICLE";
4641 const EXTRA_CRC: u8 = 184u8;
4642 const ENCODED_LEN: usize = 38usize;
4643 fn deser(
4644 _version: MavlinkVersion,
4645 __input: &[u8],
4646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4647 let avail_len = __input.len();
4648 let mut payload_buf = [0; Self::ENCODED_LEN];
4649 let mut buf = if avail_len < Self::ENCODED_LEN {
4650 payload_buf[0..avail_len].copy_from_slice(__input);
4651 Bytes::new(&payload_buf)
4652 } else {
4653 Bytes::new(__input)
4654 };
4655 let mut __struct = Self::default();
4656 __struct.ICAO_address = buf.get_u32_le();
4657 __struct.lat = buf.get_i32_le();
4658 __struct.lon = buf.get_i32_le();
4659 __struct.altitude = buf.get_i32_le();
4660 __struct.heading = buf.get_u16_le();
4661 __struct.hor_velocity = buf.get_u16_le();
4662 __struct.ver_velocity = buf.get_i16_le();
4663 let tmp = buf.get_u16_le();
4664 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4665 ::mavlink_core::error::ParserError::InvalidFlag {
4666 flag_type: "AdsbFlags",
4667 value: tmp as u32,
4668 },
4669 )?;
4670 __struct.squawk = buf.get_u16_le();
4671 let tmp = buf.get_u8();
4672 __struct.altitude_type =
4673 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4674 enum_type: "AdsbAltitudeType",
4675 value: tmp as u32,
4676 })?;
4677 for v in &mut __struct.callsign {
4678 let val = buf.get_u8();
4679 *v = val;
4680 }
4681 let tmp = buf.get_u8();
4682 __struct.emitter_type =
4683 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4684 enum_type: "AdsbEmitterType",
4685 value: tmp as u32,
4686 })?;
4687 __struct.tslc = buf.get_u8();
4688 Ok(__struct)
4689 }
4690 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4691 let mut __tmp = BytesMut::new(bytes);
4692 #[allow(clippy::absurd_extreme_comparisons)]
4693 #[allow(unused_comparisons)]
4694 if __tmp.remaining() < Self::ENCODED_LEN {
4695 panic!(
4696 "buffer is too small (need {} bytes, but got {})",
4697 Self::ENCODED_LEN,
4698 __tmp.remaining(),
4699 )
4700 }
4701 __tmp.put_u32_le(self.ICAO_address);
4702 __tmp.put_i32_le(self.lat);
4703 __tmp.put_i32_le(self.lon);
4704 __tmp.put_i32_le(self.altitude);
4705 __tmp.put_u16_le(self.heading);
4706 __tmp.put_u16_le(self.hor_velocity);
4707 __tmp.put_i16_le(self.ver_velocity);
4708 __tmp.put_u16_le(self.flags.bits());
4709 __tmp.put_u16_le(self.squawk);
4710 __tmp.put_u8(self.altitude_type as u8);
4711 for val in &self.callsign {
4712 __tmp.put_u8(*val);
4713 }
4714 __tmp.put_u8(self.emitter_type as u8);
4715 __tmp.put_u8(self.tslc);
4716 if matches!(version, MavlinkVersion::V2) {
4717 let len = __tmp.len();
4718 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4719 } else {
4720 __tmp.len()
4721 }
4722 }
4723}
4724#[doc = "id: 301"]
4725#[doc = "The location and information of an AIS vessel."]
4726#[derive(Debug, Clone, PartialEq)]
4727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4729pub struct AIS_VESSEL_DATA {
4730 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4731 pub MMSI: u32,
4732 #[doc = "Latitude"]
4733 pub lat: i32,
4734 #[doc = "Longitude"]
4735 pub lon: i32,
4736 #[doc = "Course over ground"]
4737 pub COG: u16,
4738 #[doc = "True heading"]
4739 pub heading: u16,
4740 #[doc = "Speed over ground"]
4741 pub velocity: u16,
4742 #[doc = "Distance from lat/lon location to bow"]
4743 pub dimension_bow: u16,
4744 #[doc = "Distance from lat/lon location to stern"]
4745 pub dimension_stern: u16,
4746 #[doc = "Time since last communication in seconds"]
4747 pub tslc: u16,
4748 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4749 pub flags: AisFlags,
4750 #[doc = "Turn rate"]
4751 pub turn_rate: i8,
4752 #[doc = "Navigational status"]
4753 pub navigational_status: AisNavStatus,
4754 #[doc = "Type of vessels"]
4755 pub mavtype: AisType,
4756 #[doc = "Distance from lat/lon location to port side"]
4757 pub dimension_port: u8,
4758 #[doc = "Distance from lat/lon location to starboard side"]
4759 pub dimension_starboard: u8,
4760 #[doc = "The vessel callsign"]
4761 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4762 pub callsign: [u8; 7],
4763 #[doc = "The vessel name"]
4764 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4765 pub name: [u8; 20],
4766}
4767impl AIS_VESSEL_DATA {
4768 pub const ENCODED_LEN: usize = 58usize;
4769 pub const DEFAULT: Self = Self {
4770 MMSI: 0_u32,
4771 lat: 0_i32,
4772 lon: 0_i32,
4773 COG: 0_u16,
4774 heading: 0_u16,
4775 velocity: 0_u16,
4776 dimension_bow: 0_u16,
4777 dimension_stern: 0_u16,
4778 tslc: 0_u16,
4779 flags: AisFlags::DEFAULT,
4780 turn_rate: 0_i8,
4781 navigational_status: AisNavStatus::DEFAULT,
4782 mavtype: AisType::DEFAULT,
4783 dimension_port: 0_u8,
4784 dimension_starboard: 0_u8,
4785 callsign: [0_u8; 7usize],
4786 name: [0_u8; 20usize],
4787 };
4788 #[cfg(feature = "arbitrary")]
4789 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4790 use arbitrary::{Arbitrary, Unstructured};
4791 let mut buf = [0u8; 1024];
4792 rng.fill_bytes(&mut buf);
4793 let mut unstructured = Unstructured::new(&buf);
4794 Self::arbitrary(&mut unstructured).unwrap_or_default()
4795 }
4796}
4797impl Default for AIS_VESSEL_DATA {
4798 fn default() -> Self {
4799 Self::DEFAULT.clone()
4800 }
4801}
4802impl MessageData for AIS_VESSEL_DATA {
4803 type Message = MavMessage;
4804 const ID: u32 = 301u32;
4805 const NAME: &'static str = "AIS_VESSEL";
4806 const EXTRA_CRC: u8 = 243u8;
4807 const ENCODED_LEN: usize = 58usize;
4808 fn deser(
4809 _version: MavlinkVersion,
4810 __input: &[u8],
4811 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4812 let avail_len = __input.len();
4813 let mut payload_buf = [0; Self::ENCODED_LEN];
4814 let mut buf = if avail_len < Self::ENCODED_LEN {
4815 payload_buf[0..avail_len].copy_from_slice(__input);
4816 Bytes::new(&payload_buf)
4817 } else {
4818 Bytes::new(__input)
4819 };
4820 let mut __struct = Self::default();
4821 __struct.MMSI = buf.get_u32_le();
4822 __struct.lat = buf.get_i32_le();
4823 __struct.lon = buf.get_i32_le();
4824 __struct.COG = buf.get_u16_le();
4825 __struct.heading = buf.get_u16_le();
4826 __struct.velocity = buf.get_u16_le();
4827 __struct.dimension_bow = buf.get_u16_le();
4828 __struct.dimension_stern = buf.get_u16_le();
4829 __struct.tslc = buf.get_u16_le();
4830 let tmp = buf.get_u16_le();
4831 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4832 ::mavlink_core::error::ParserError::InvalidFlag {
4833 flag_type: "AisFlags",
4834 value: tmp as u32,
4835 },
4836 )?;
4837 __struct.turn_rate = buf.get_i8();
4838 let tmp = buf.get_u8();
4839 __struct.navigational_status =
4840 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4841 enum_type: "AisNavStatus",
4842 value: tmp as u32,
4843 })?;
4844 let tmp = buf.get_u8();
4845 __struct.mavtype =
4846 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4847 enum_type: "AisType",
4848 value: tmp as u32,
4849 })?;
4850 __struct.dimension_port = buf.get_u8();
4851 __struct.dimension_starboard = buf.get_u8();
4852 for v in &mut __struct.callsign {
4853 let val = buf.get_u8();
4854 *v = val;
4855 }
4856 for v in &mut __struct.name {
4857 let val = buf.get_u8();
4858 *v = val;
4859 }
4860 Ok(__struct)
4861 }
4862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4863 let mut __tmp = BytesMut::new(bytes);
4864 #[allow(clippy::absurd_extreme_comparisons)]
4865 #[allow(unused_comparisons)]
4866 if __tmp.remaining() < Self::ENCODED_LEN {
4867 panic!(
4868 "buffer is too small (need {} bytes, but got {})",
4869 Self::ENCODED_LEN,
4870 __tmp.remaining(),
4871 )
4872 }
4873 __tmp.put_u32_le(self.MMSI);
4874 __tmp.put_i32_le(self.lat);
4875 __tmp.put_i32_le(self.lon);
4876 __tmp.put_u16_le(self.COG);
4877 __tmp.put_u16_le(self.heading);
4878 __tmp.put_u16_le(self.velocity);
4879 __tmp.put_u16_le(self.dimension_bow);
4880 __tmp.put_u16_le(self.dimension_stern);
4881 __tmp.put_u16_le(self.tslc);
4882 __tmp.put_u16_le(self.flags.bits());
4883 __tmp.put_i8(self.turn_rate);
4884 __tmp.put_u8(self.navigational_status as u8);
4885 __tmp.put_u8(self.mavtype as u8);
4886 __tmp.put_u8(self.dimension_port);
4887 __tmp.put_u8(self.dimension_starboard);
4888 for val in &self.callsign {
4889 __tmp.put_u8(*val);
4890 }
4891 for val in &self.name {
4892 __tmp.put_u8(*val);
4893 }
4894 if matches!(version, MavlinkVersion::V2) {
4895 let len = __tmp.len();
4896 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4897 } else {
4898 __tmp.len()
4899 }
4900 }
4901}
4902#[doc = "id: 141"]
4903#[doc = "The current system altitude."]
4904#[derive(Debug, Clone, PartialEq)]
4905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4907pub struct ALTITUDE_DATA {
4908 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4909 pub time_usec: u64,
4910 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
4911 pub altitude_monotonic: f32,
4912 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
4913 pub altitude_amsl: f32,
4914 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
4915 pub altitude_local: f32,
4916 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
4917 pub altitude_relative: f32,
4918 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
4919 pub altitude_terrain: f32,
4920 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
4921 pub bottom_clearance: f32,
4922}
4923impl ALTITUDE_DATA {
4924 pub const ENCODED_LEN: usize = 32usize;
4925 pub const DEFAULT: Self = Self {
4926 time_usec: 0_u64,
4927 altitude_monotonic: 0.0_f32,
4928 altitude_amsl: 0.0_f32,
4929 altitude_local: 0.0_f32,
4930 altitude_relative: 0.0_f32,
4931 altitude_terrain: 0.0_f32,
4932 bottom_clearance: 0.0_f32,
4933 };
4934 #[cfg(feature = "arbitrary")]
4935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4936 use arbitrary::{Arbitrary, Unstructured};
4937 let mut buf = [0u8; 1024];
4938 rng.fill_bytes(&mut buf);
4939 let mut unstructured = Unstructured::new(&buf);
4940 Self::arbitrary(&mut unstructured).unwrap_or_default()
4941 }
4942}
4943impl Default for ALTITUDE_DATA {
4944 fn default() -> Self {
4945 Self::DEFAULT.clone()
4946 }
4947}
4948impl MessageData for ALTITUDE_DATA {
4949 type Message = MavMessage;
4950 const ID: u32 = 141u32;
4951 const NAME: &'static str = "ALTITUDE";
4952 const EXTRA_CRC: u8 = 47u8;
4953 const ENCODED_LEN: usize = 32usize;
4954 fn deser(
4955 _version: MavlinkVersion,
4956 __input: &[u8],
4957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4958 let avail_len = __input.len();
4959 let mut payload_buf = [0; Self::ENCODED_LEN];
4960 let mut buf = if avail_len < Self::ENCODED_LEN {
4961 payload_buf[0..avail_len].copy_from_slice(__input);
4962 Bytes::new(&payload_buf)
4963 } else {
4964 Bytes::new(__input)
4965 };
4966 let mut __struct = Self::default();
4967 __struct.time_usec = buf.get_u64_le();
4968 __struct.altitude_monotonic = buf.get_f32_le();
4969 __struct.altitude_amsl = buf.get_f32_le();
4970 __struct.altitude_local = buf.get_f32_le();
4971 __struct.altitude_relative = buf.get_f32_le();
4972 __struct.altitude_terrain = buf.get_f32_le();
4973 __struct.bottom_clearance = buf.get_f32_le();
4974 Ok(__struct)
4975 }
4976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4977 let mut __tmp = BytesMut::new(bytes);
4978 #[allow(clippy::absurd_extreme_comparisons)]
4979 #[allow(unused_comparisons)]
4980 if __tmp.remaining() < Self::ENCODED_LEN {
4981 panic!(
4982 "buffer is too small (need {} bytes, but got {})",
4983 Self::ENCODED_LEN,
4984 __tmp.remaining(),
4985 )
4986 }
4987 __tmp.put_u64_le(self.time_usec);
4988 __tmp.put_f32_le(self.altitude_monotonic);
4989 __tmp.put_f32_le(self.altitude_amsl);
4990 __tmp.put_f32_le(self.altitude_local);
4991 __tmp.put_f32_le(self.altitude_relative);
4992 __tmp.put_f32_le(self.altitude_terrain);
4993 __tmp.put_f32_le(self.bottom_clearance);
4994 if matches!(version, MavlinkVersion::V2) {
4995 let len = __tmp.len();
4996 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4997 } else {
4998 __tmp.len()
4999 }
5000 }
5001}
5002#[doc = "id: 30"]
5003#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5004#[derive(Debug, Clone, PartialEq)]
5005#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5006#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5007pub struct ATTITUDE_DATA {
5008 #[doc = "Timestamp (time since system boot)."]
5009 pub time_boot_ms: u32,
5010 #[doc = "Roll angle (-pi..+pi)"]
5011 pub roll: f32,
5012 #[doc = "Pitch angle (-pi..+pi)"]
5013 pub pitch: f32,
5014 #[doc = "Yaw angle (-pi..+pi)"]
5015 pub yaw: f32,
5016 #[doc = "Roll angular speed"]
5017 pub rollspeed: f32,
5018 #[doc = "Pitch angular speed"]
5019 pub pitchspeed: f32,
5020 #[doc = "Yaw angular speed"]
5021 pub yawspeed: f32,
5022}
5023impl ATTITUDE_DATA {
5024 pub const ENCODED_LEN: usize = 28usize;
5025 pub const DEFAULT: Self = Self {
5026 time_boot_ms: 0_u32,
5027 roll: 0.0_f32,
5028 pitch: 0.0_f32,
5029 yaw: 0.0_f32,
5030 rollspeed: 0.0_f32,
5031 pitchspeed: 0.0_f32,
5032 yawspeed: 0.0_f32,
5033 };
5034 #[cfg(feature = "arbitrary")]
5035 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5036 use arbitrary::{Arbitrary, Unstructured};
5037 let mut buf = [0u8; 1024];
5038 rng.fill_bytes(&mut buf);
5039 let mut unstructured = Unstructured::new(&buf);
5040 Self::arbitrary(&mut unstructured).unwrap_or_default()
5041 }
5042}
5043impl Default for ATTITUDE_DATA {
5044 fn default() -> Self {
5045 Self::DEFAULT.clone()
5046 }
5047}
5048impl MessageData for ATTITUDE_DATA {
5049 type Message = MavMessage;
5050 const ID: u32 = 30u32;
5051 const NAME: &'static str = "ATTITUDE";
5052 const EXTRA_CRC: u8 = 39u8;
5053 const ENCODED_LEN: usize = 28usize;
5054 fn deser(
5055 _version: MavlinkVersion,
5056 __input: &[u8],
5057 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5058 let avail_len = __input.len();
5059 let mut payload_buf = [0; Self::ENCODED_LEN];
5060 let mut buf = if avail_len < Self::ENCODED_LEN {
5061 payload_buf[0..avail_len].copy_from_slice(__input);
5062 Bytes::new(&payload_buf)
5063 } else {
5064 Bytes::new(__input)
5065 };
5066 let mut __struct = Self::default();
5067 __struct.time_boot_ms = buf.get_u32_le();
5068 __struct.roll = buf.get_f32_le();
5069 __struct.pitch = buf.get_f32_le();
5070 __struct.yaw = buf.get_f32_le();
5071 __struct.rollspeed = buf.get_f32_le();
5072 __struct.pitchspeed = buf.get_f32_le();
5073 __struct.yawspeed = buf.get_f32_le();
5074 Ok(__struct)
5075 }
5076 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5077 let mut __tmp = BytesMut::new(bytes);
5078 #[allow(clippy::absurd_extreme_comparisons)]
5079 #[allow(unused_comparisons)]
5080 if __tmp.remaining() < Self::ENCODED_LEN {
5081 panic!(
5082 "buffer is too small (need {} bytes, but got {})",
5083 Self::ENCODED_LEN,
5084 __tmp.remaining(),
5085 )
5086 }
5087 __tmp.put_u32_le(self.time_boot_ms);
5088 __tmp.put_f32_le(self.roll);
5089 __tmp.put_f32_le(self.pitch);
5090 __tmp.put_f32_le(self.yaw);
5091 __tmp.put_f32_le(self.rollspeed);
5092 __tmp.put_f32_le(self.pitchspeed);
5093 __tmp.put_f32_le(self.yawspeed);
5094 if matches!(version, MavlinkVersion::V2) {
5095 let len = __tmp.len();
5096 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5097 } else {
5098 __tmp.len()
5099 }
5100 }
5101}
5102#[doc = "id: 31"]
5103#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5104#[derive(Debug, Clone, PartialEq)]
5105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5107pub struct ATTITUDE_QUATERNION_DATA {
5108 #[doc = "Timestamp (time since system boot)."]
5109 pub time_boot_ms: u32,
5110 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5111 pub q1: f32,
5112 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5113 pub q2: f32,
5114 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5115 pub q3: f32,
5116 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5117 pub q4: f32,
5118 #[doc = "Roll angular speed"]
5119 pub rollspeed: f32,
5120 #[doc = "Pitch angular speed"]
5121 pub pitchspeed: f32,
5122 #[doc = "Yaw angular speed"]
5123 pub yawspeed: f32,
5124 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5125 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5126 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5127 pub repr_offset_q: [f32; 4],
5128}
5129impl ATTITUDE_QUATERNION_DATA {
5130 pub const ENCODED_LEN: usize = 48usize;
5131 pub const DEFAULT: Self = Self {
5132 time_boot_ms: 0_u32,
5133 q1: 0.0_f32,
5134 q2: 0.0_f32,
5135 q3: 0.0_f32,
5136 q4: 0.0_f32,
5137 rollspeed: 0.0_f32,
5138 pitchspeed: 0.0_f32,
5139 yawspeed: 0.0_f32,
5140 repr_offset_q: [0.0_f32; 4usize],
5141 };
5142 #[cfg(feature = "arbitrary")]
5143 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5144 use arbitrary::{Arbitrary, Unstructured};
5145 let mut buf = [0u8; 1024];
5146 rng.fill_bytes(&mut buf);
5147 let mut unstructured = Unstructured::new(&buf);
5148 Self::arbitrary(&mut unstructured).unwrap_or_default()
5149 }
5150}
5151impl Default for ATTITUDE_QUATERNION_DATA {
5152 fn default() -> Self {
5153 Self::DEFAULT.clone()
5154 }
5155}
5156impl MessageData for ATTITUDE_QUATERNION_DATA {
5157 type Message = MavMessage;
5158 const ID: u32 = 31u32;
5159 const NAME: &'static str = "ATTITUDE_QUATERNION";
5160 const EXTRA_CRC: u8 = 246u8;
5161 const ENCODED_LEN: usize = 48usize;
5162 fn deser(
5163 _version: MavlinkVersion,
5164 __input: &[u8],
5165 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5166 let avail_len = __input.len();
5167 let mut payload_buf = [0; Self::ENCODED_LEN];
5168 let mut buf = if avail_len < Self::ENCODED_LEN {
5169 payload_buf[0..avail_len].copy_from_slice(__input);
5170 Bytes::new(&payload_buf)
5171 } else {
5172 Bytes::new(__input)
5173 };
5174 let mut __struct = Self::default();
5175 __struct.time_boot_ms = buf.get_u32_le();
5176 __struct.q1 = buf.get_f32_le();
5177 __struct.q2 = buf.get_f32_le();
5178 __struct.q3 = buf.get_f32_le();
5179 __struct.q4 = buf.get_f32_le();
5180 __struct.rollspeed = buf.get_f32_le();
5181 __struct.pitchspeed = buf.get_f32_le();
5182 __struct.yawspeed = buf.get_f32_le();
5183 for v in &mut __struct.repr_offset_q {
5184 let val = buf.get_f32_le();
5185 *v = val;
5186 }
5187 Ok(__struct)
5188 }
5189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5190 let mut __tmp = BytesMut::new(bytes);
5191 #[allow(clippy::absurd_extreme_comparisons)]
5192 #[allow(unused_comparisons)]
5193 if __tmp.remaining() < Self::ENCODED_LEN {
5194 panic!(
5195 "buffer is too small (need {} bytes, but got {})",
5196 Self::ENCODED_LEN,
5197 __tmp.remaining(),
5198 )
5199 }
5200 __tmp.put_u32_le(self.time_boot_ms);
5201 __tmp.put_f32_le(self.q1);
5202 __tmp.put_f32_le(self.q2);
5203 __tmp.put_f32_le(self.q3);
5204 __tmp.put_f32_le(self.q4);
5205 __tmp.put_f32_le(self.rollspeed);
5206 __tmp.put_f32_le(self.pitchspeed);
5207 __tmp.put_f32_le(self.yawspeed);
5208 for val in &self.repr_offset_q {
5209 __tmp.put_f32_le(*val);
5210 }
5211 if matches!(version, MavlinkVersion::V2) {
5212 let len = __tmp.len();
5213 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5214 } else {
5215 __tmp.len()
5216 }
5217 }
5218}
5219#[doc = "id: 61"]
5220#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5221#[derive(Debug, Clone, PartialEq)]
5222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5224pub struct ATTITUDE_QUATERNION_COV_DATA {
5225 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5226 pub time_usec: u64,
5227 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5229 pub q: [f32; 4],
5230 #[doc = "Roll angular speed"]
5231 pub rollspeed: f32,
5232 #[doc = "Pitch angular speed"]
5233 pub pitchspeed: f32,
5234 #[doc = "Yaw angular speed"]
5235 pub yawspeed: f32,
5236 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5237 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5238 pub covariance: [f32; 9],
5239}
5240impl ATTITUDE_QUATERNION_COV_DATA {
5241 pub const ENCODED_LEN: usize = 72usize;
5242 pub const DEFAULT: Self = Self {
5243 time_usec: 0_u64,
5244 q: [0.0_f32; 4usize],
5245 rollspeed: 0.0_f32,
5246 pitchspeed: 0.0_f32,
5247 yawspeed: 0.0_f32,
5248 covariance: [0.0_f32; 9usize],
5249 };
5250 #[cfg(feature = "arbitrary")]
5251 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5252 use arbitrary::{Arbitrary, Unstructured};
5253 let mut buf = [0u8; 1024];
5254 rng.fill_bytes(&mut buf);
5255 let mut unstructured = Unstructured::new(&buf);
5256 Self::arbitrary(&mut unstructured).unwrap_or_default()
5257 }
5258}
5259impl Default for ATTITUDE_QUATERNION_COV_DATA {
5260 fn default() -> Self {
5261 Self::DEFAULT.clone()
5262 }
5263}
5264impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5265 type Message = MavMessage;
5266 const ID: u32 = 61u32;
5267 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5268 const EXTRA_CRC: u8 = 167u8;
5269 const ENCODED_LEN: usize = 72usize;
5270 fn deser(
5271 _version: MavlinkVersion,
5272 __input: &[u8],
5273 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5274 let avail_len = __input.len();
5275 let mut payload_buf = [0; Self::ENCODED_LEN];
5276 let mut buf = if avail_len < Self::ENCODED_LEN {
5277 payload_buf[0..avail_len].copy_from_slice(__input);
5278 Bytes::new(&payload_buf)
5279 } else {
5280 Bytes::new(__input)
5281 };
5282 let mut __struct = Self::default();
5283 __struct.time_usec = buf.get_u64_le();
5284 for v in &mut __struct.q {
5285 let val = buf.get_f32_le();
5286 *v = val;
5287 }
5288 __struct.rollspeed = buf.get_f32_le();
5289 __struct.pitchspeed = buf.get_f32_le();
5290 __struct.yawspeed = buf.get_f32_le();
5291 for v in &mut __struct.covariance {
5292 let val = buf.get_f32_le();
5293 *v = val;
5294 }
5295 Ok(__struct)
5296 }
5297 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5298 let mut __tmp = BytesMut::new(bytes);
5299 #[allow(clippy::absurd_extreme_comparisons)]
5300 #[allow(unused_comparisons)]
5301 if __tmp.remaining() < Self::ENCODED_LEN {
5302 panic!(
5303 "buffer is too small (need {} bytes, but got {})",
5304 Self::ENCODED_LEN,
5305 __tmp.remaining(),
5306 )
5307 }
5308 __tmp.put_u64_le(self.time_usec);
5309 for val in &self.q {
5310 __tmp.put_f32_le(*val);
5311 }
5312 __tmp.put_f32_le(self.rollspeed);
5313 __tmp.put_f32_le(self.pitchspeed);
5314 __tmp.put_f32_le(self.yawspeed);
5315 for val in &self.covariance {
5316 __tmp.put_f32_le(*val);
5317 }
5318 if matches!(version, MavlinkVersion::V2) {
5319 let len = __tmp.len();
5320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5321 } else {
5322 __tmp.len()
5323 }
5324 }
5325}
5326#[doc = "id: 83"]
5327#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5328#[derive(Debug, Clone, PartialEq)]
5329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5331pub struct ATTITUDE_TARGET_DATA {
5332 #[doc = "Timestamp (time since system boot)."]
5333 pub time_boot_ms: u32,
5334 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5335 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5336 pub q: [f32; 4],
5337 #[doc = "Body roll rate"]
5338 pub body_roll_rate: f32,
5339 #[doc = "Body pitch rate"]
5340 pub body_pitch_rate: f32,
5341 #[doc = "Body yaw rate"]
5342 pub body_yaw_rate: f32,
5343 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5344 pub thrust: f32,
5345 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5346 pub type_mask: AttitudeTargetTypemask,
5347}
5348impl ATTITUDE_TARGET_DATA {
5349 pub const ENCODED_LEN: usize = 37usize;
5350 pub const DEFAULT: Self = Self {
5351 time_boot_ms: 0_u32,
5352 q: [0.0_f32; 4usize],
5353 body_roll_rate: 0.0_f32,
5354 body_pitch_rate: 0.0_f32,
5355 body_yaw_rate: 0.0_f32,
5356 thrust: 0.0_f32,
5357 type_mask: AttitudeTargetTypemask::DEFAULT,
5358 };
5359 #[cfg(feature = "arbitrary")]
5360 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5361 use arbitrary::{Arbitrary, Unstructured};
5362 let mut buf = [0u8; 1024];
5363 rng.fill_bytes(&mut buf);
5364 let mut unstructured = Unstructured::new(&buf);
5365 Self::arbitrary(&mut unstructured).unwrap_or_default()
5366 }
5367}
5368impl Default for ATTITUDE_TARGET_DATA {
5369 fn default() -> Self {
5370 Self::DEFAULT.clone()
5371 }
5372}
5373impl MessageData for ATTITUDE_TARGET_DATA {
5374 type Message = MavMessage;
5375 const ID: u32 = 83u32;
5376 const NAME: &'static str = "ATTITUDE_TARGET";
5377 const EXTRA_CRC: u8 = 22u8;
5378 const ENCODED_LEN: usize = 37usize;
5379 fn deser(
5380 _version: MavlinkVersion,
5381 __input: &[u8],
5382 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5383 let avail_len = __input.len();
5384 let mut payload_buf = [0; Self::ENCODED_LEN];
5385 let mut buf = if avail_len < Self::ENCODED_LEN {
5386 payload_buf[0..avail_len].copy_from_slice(__input);
5387 Bytes::new(&payload_buf)
5388 } else {
5389 Bytes::new(__input)
5390 };
5391 let mut __struct = Self::default();
5392 __struct.time_boot_ms = buf.get_u32_le();
5393 for v in &mut __struct.q {
5394 let val = buf.get_f32_le();
5395 *v = val;
5396 }
5397 __struct.body_roll_rate = buf.get_f32_le();
5398 __struct.body_pitch_rate = buf.get_f32_le();
5399 __struct.body_yaw_rate = buf.get_f32_le();
5400 __struct.thrust = buf.get_f32_le();
5401 let tmp = buf.get_u8();
5402 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5403 tmp & AttitudeTargetTypemask::all().bits(),
5404 )
5405 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5406 flag_type: "AttitudeTargetTypemask",
5407 value: tmp as u32,
5408 })?;
5409 Ok(__struct)
5410 }
5411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5412 let mut __tmp = BytesMut::new(bytes);
5413 #[allow(clippy::absurd_extreme_comparisons)]
5414 #[allow(unused_comparisons)]
5415 if __tmp.remaining() < Self::ENCODED_LEN {
5416 panic!(
5417 "buffer is too small (need {} bytes, but got {})",
5418 Self::ENCODED_LEN,
5419 __tmp.remaining(),
5420 )
5421 }
5422 __tmp.put_u32_le(self.time_boot_ms);
5423 for val in &self.q {
5424 __tmp.put_f32_le(*val);
5425 }
5426 __tmp.put_f32_le(self.body_roll_rate);
5427 __tmp.put_f32_le(self.body_pitch_rate);
5428 __tmp.put_f32_le(self.body_yaw_rate);
5429 __tmp.put_f32_le(self.thrust);
5430 __tmp.put_u8(self.type_mask.bits());
5431 if matches!(version, MavlinkVersion::V2) {
5432 let len = __tmp.len();
5433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5434 } else {
5435 __tmp.len()
5436 }
5437 }
5438}
5439#[doc = "id: 138"]
5440#[doc = "Motion capture attitude and position."]
5441#[derive(Debug, Clone, PartialEq)]
5442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5444pub struct ATT_POS_MOCAP_DATA {
5445 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5446 pub time_usec: u64,
5447 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5448 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5449 pub q: [f32; 4],
5450 #[doc = "X position (NED)"]
5451 pub x: f32,
5452 #[doc = "Y position (NED)"]
5453 pub y: f32,
5454 #[doc = "Z position (NED)"]
5455 pub z: f32,
5456 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5457 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5459 pub covariance: [f32; 21],
5460}
5461impl ATT_POS_MOCAP_DATA {
5462 pub const ENCODED_LEN: usize = 120usize;
5463 pub const DEFAULT: Self = Self {
5464 time_usec: 0_u64,
5465 q: [0.0_f32; 4usize],
5466 x: 0.0_f32,
5467 y: 0.0_f32,
5468 z: 0.0_f32,
5469 covariance: [0.0_f32; 21usize],
5470 };
5471 #[cfg(feature = "arbitrary")]
5472 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5473 use arbitrary::{Arbitrary, Unstructured};
5474 let mut buf = [0u8; 1024];
5475 rng.fill_bytes(&mut buf);
5476 let mut unstructured = Unstructured::new(&buf);
5477 Self::arbitrary(&mut unstructured).unwrap_or_default()
5478 }
5479}
5480impl Default for ATT_POS_MOCAP_DATA {
5481 fn default() -> Self {
5482 Self::DEFAULT.clone()
5483 }
5484}
5485impl MessageData for ATT_POS_MOCAP_DATA {
5486 type Message = MavMessage;
5487 const ID: u32 = 138u32;
5488 const NAME: &'static str = "ATT_POS_MOCAP";
5489 const EXTRA_CRC: u8 = 109u8;
5490 const ENCODED_LEN: usize = 120usize;
5491 fn deser(
5492 _version: MavlinkVersion,
5493 __input: &[u8],
5494 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5495 let avail_len = __input.len();
5496 let mut payload_buf = [0; Self::ENCODED_LEN];
5497 let mut buf = if avail_len < Self::ENCODED_LEN {
5498 payload_buf[0..avail_len].copy_from_slice(__input);
5499 Bytes::new(&payload_buf)
5500 } else {
5501 Bytes::new(__input)
5502 };
5503 let mut __struct = Self::default();
5504 __struct.time_usec = buf.get_u64_le();
5505 for v in &mut __struct.q {
5506 let val = buf.get_f32_le();
5507 *v = val;
5508 }
5509 __struct.x = buf.get_f32_le();
5510 __struct.y = buf.get_f32_le();
5511 __struct.z = buf.get_f32_le();
5512 for v in &mut __struct.covariance {
5513 let val = buf.get_f32_le();
5514 *v = val;
5515 }
5516 Ok(__struct)
5517 }
5518 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5519 let mut __tmp = BytesMut::new(bytes);
5520 #[allow(clippy::absurd_extreme_comparisons)]
5521 #[allow(unused_comparisons)]
5522 if __tmp.remaining() < Self::ENCODED_LEN {
5523 panic!(
5524 "buffer is too small (need {} bytes, but got {})",
5525 Self::ENCODED_LEN,
5526 __tmp.remaining(),
5527 )
5528 }
5529 __tmp.put_u64_le(self.time_usec);
5530 for val in &self.q {
5531 __tmp.put_f32_le(*val);
5532 }
5533 __tmp.put_f32_le(self.x);
5534 __tmp.put_f32_le(self.y);
5535 __tmp.put_f32_le(self.z);
5536 for val in &self.covariance {
5537 __tmp.put_f32_le(*val);
5538 }
5539 if matches!(version, MavlinkVersion::V2) {
5540 let len = __tmp.len();
5541 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5542 } else {
5543 __tmp.len()
5544 }
5545 }
5546}
5547#[doc = "id: 7"]
5548#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5549#[derive(Debug, Clone, PartialEq)]
5550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5552pub struct AUTH_KEY_DATA {
5553 #[doc = "key"]
5554 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5555 pub key: [u8; 32],
5556}
5557impl AUTH_KEY_DATA {
5558 pub const ENCODED_LEN: usize = 32usize;
5559 pub const DEFAULT: Self = Self {
5560 key: [0_u8; 32usize],
5561 };
5562 #[cfg(feature = "arbitrary")]
5563 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5564 use arbitrary::{Arbitrary, Unstructured};
5565 let mut buf = [0u8; 1024];
5566 rng.fill_bytes(&mut buf);
5567 let mut unstructured = Unstructured::new(&buf);
5568 Self::arbitrary(&mut unstructured).unwrap_or_default()
5569 }
5570}
5571impl Default for AUTH_KEY_DATA {
5572 fn default() -> Self {
5573 Self::DEFAULT.clone()
5574 }
5575}
5576impl MessageData for AUTH_KEY_DATA {
5577 type Message = MavMessage;
5578 const ID: u32 = 7u32;
5579 const NAME: &'static str = "AUTH_KEY";
5580 const EXTRA_CRC: u8 = 119u8;
5581 const ENCODED_LEN: usize = 32usize;
5582 fn deser(
5583 _version: MavlinkVersion,
5584 __input: &[u8],
5585 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5586 let avail_len = __input.len();
5587 let mut payload_buf = [0; Self::ENCODED_LEN];
5588 let mut buf = if avail_len < Self::ENCODED_LEN {
5589 payload_buf[0..avail_len].copy_from_slice(__input);
5590 Bytes::new(&payload_buf)
5591 } else {
5592 Bytes::new(__input)
5593 };
5594 let mut __struct = Self::default();
5595 for v in &mut __struct.key {
5596 let val = buf.get_u8();
5597 *v = val;
5598 }
5599 Ok(__struct)
5600 }
5601 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5602 let mut __tmp = BytesMut::new(bytes);
5603 #[allow(clippy::absurd_extreme_comparisons)]
5604 #[allow(unused_comparisons)]
5605 if __tmp.remaining() < Self::ENCODED_LEN {
5606 panic!(
5607 "buffer is too small (need {} bytes, but got {})",
5608 Self::ENCODED_LEN,
5609 __tmp.remaining(),
5610 )
5611 }
5612 for val in &self.key {
5613 __tmp.put_u8(*val);
5614 }
5615 if matches!(version, MavlinkVersion::V2) {
5616 let len = __tmp.len();
5617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5618 } else {
5619 __tmp.len()
5620 }
5621 }
5622}
5623#[doc = "id: 286"]
5624#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5625#[derive(Debug, Clone, PartialEq)]
5626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5628pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5629 #[doc = "Timestamp (time since system boot)."]
5630 pub time_boot_us: u64,
5631 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5632 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5633 pub q: [f32; 4],
5634 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5635 pub q_estimated_delay_us: u32,
5636 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5637 pub vx: f32,
5638 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5639 pub vy: f32,
5640 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5641 pub vz: f32,
5642 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5643 pub v_estimated_delay_us: u32,
5644 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5645 pub feed_forward_angular_velocity_z: f32,
5646 #[doc = "Bitmap indicating which estimator outputs are valid."]
5647 pub estimator_status: EstimatorStatusFlags,
5648 #[doc = "System ID"]
5649 pub target_system: u8,
5650 #[doc = "Component ID"]
5651 pub target_component: u8,
5652 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5653 pub landed_state: MavLandedState,
5654 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5655 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5656 pub angular_velocity_z: f32,
5657}
5658impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5659 pub const ENCODED_LEN: usize = 57usize;
5660 pub const DEFAULT: Self = Self {
5661 time_boot_us: 0_u64,
5662 q: [0.0_f32; 4usize],
5663 q_estimated_delay_us: 0_u32,
5664 vx: 0.0_f32,
5665 vy: 0.0_f32,
5666 vz: 0.0_f32,
5667 v_estimated_delay_us: 0_u32,
5668 feed_forward_angular_velocity_z: 0.0_f32,
5669 estimator_status: EstimatorStatusFlags::DEFAULT,
5670 target_system: 0_u8,
5671 target_component: 0_u8,
5672 landed_state: MavLandedState::DEFAULT,
5673 angular_velocity_z: 0.0_f32,
5674 };
5675 #[cfg(feature = "arbitrary")]
5676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5677 use arbitrary::{Arbitrary, Unstructured};
5678 let mut buf = [0u8; 1024];
5679 rng.fill_bytes(&mut buf);
5680 let mut unstructured = Unstructured::new(&buf);
5681 Self::arbitrary(&mut unstructured).unwrap_or_default()
5682 }
5683}
5684impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5685 fn default() -> Self {
5686 Self::DEFAULT.clone()
5687 }
5688}
5689impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5690 type Message = MavMessage;
5691 const ID: u32 = 286u32;
5692 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5693 const EXTRA_CRC: u8 = 210u8;
5694 const ENCODED_LEN: usize = 57usize;
5695 fn deser(
5696 _version: MavlinkVersion,
5697 __input: &[u8],
5698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5699 let avail_len = __input.len();
5700 let mut payload_buf = [0; Self::ENCODED_LEN];
5701 let mut buf = if avail_len < Self::ENCODED_LEN {
5702 payload_buf[0..avail_len].copy_from_slice(__input);
5703 Bytes::new(&payload_buf)
5704 } else {
5705 Bytes::new(__input)
5706 };
5707 let mut __struct = Self::default();
5708 __struct.time_boot_us = buf.get_u64_le();
5709 for v in &mut __struct.q {
5710 let val = buf.get_f32_le();
5711 *v = val;
5712 }
5713 __struct.q_estimated_delay_us = buf.get_u32_le();
5714 __struct.vx = buf.get_f32_le();
5715 __struct.vy = buf.get_f32_le();
5716 __struct.vz = buf.get_f32_le();
5717 __struct.v_estimated_delay_us = buf.get_u32_le();
5718 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5719 let tmp = buf.get_u16_le();
5720 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5721 tmp & EstimatorStatusFlags::all().bits(),
5722 )
5723 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5724 flag_type: "EstimatorStatusFlags",
5725 value: tmp as u32,
5726 })?;
5727 __struct.target_system = buf.get_u8();
5728 __struct.target_component = buf.get_u8();
5729 let tmp = buf.get_u8();
5730 __struct.landed_state =
5731 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5732 enum_type: "MavLandedState",
5733 value: tmp as u32,
5734 })?;
5735 __struct.angular_velocity_z = buf.get_f32_le();
5736 Ok(__struct)
5737 }
5738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5739 let mut __tmp = BytesMut::new(bytes);
5740 #[allow(clippy::absurd_extreme_comparisons)]
5741 #[allow(unused_comparisons)]
5742 if __tmp.remaining() < Self::ENCODED_LEN {
5743 panic!(
5744 "buffer is too small (need {} bytes, but got {})",
5745 Self::ENCODED_LEN,
5746 __tmp.remaining(),
5747 )
5748 }
5749 __tmp.put_u64_le(self.time_boot_us);
5750 for val in &self.q {
5751 __tmp.put_f32_le(*val);
5752 }
5753 __tmp.put_u32_le(self.q_estimated_delay_us);
5754 __tmp.put_f32_le(self.vx);
5755 __tmp.put_f32_le(self.vy);
5756 __tmp.put_f32_le(self.vz);
5757 __tmp.put_u32_le(self.v_estimated_delay_us);
5758 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
5759 __tmp.put_u16_le(self.estimator_status.bits());
5760 __tmp.put_u8(self.target_system);
5761 __tmp.put_u8(self.target_component);
5762 __tmp.put_u8(self.landed_state as u8);
5763 __tmp.put_f32_le(self.angular_velocity_z);
5764 if matches!(version, MavlinkVersion::V2) {
5765 let len = __tmp.len();
5766 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5767 } else {
5768 __tmp.len()
5769 }
5770 }
5771}
5772#[doc = "id: 148"]
5773#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
5774#[derive(Debug, Clone, PartialEq)]
5775#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5776#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5777pub struct AUTOPILOT_VERSION_DATA {
5778 #[doc = "Bitmap of capabilities"]
5779 pub capabilities: MavProtocolCapability,
5780 #[doc = "UID if provided by hardware (see uid2)"]
5781 pub uid: u64,
5782 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
5783 pub flight_sw_version: u32,
5784 #[doc = "Middleware version number"]
5785 pub middleware_sw_version: u32,
5786 #[doc = "Operating system version number"]
5787 pub os_sw_version: u32,
5788 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
5789 pub board_version: u32,
5790 #[doc = "ID of the board vendor"]
5791 pub vendor_id: u16,
5792 #[doc = "ID of the product"]
5793 pub product_id: u16,
5794 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5796 pub flight_custom_version: [u8; 8],
5797 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5798 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5799 pub middleware_custom_version: [u8; 8],
5800 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5801 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5802 pub os_custom_version: [u8; 8],
5803 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
5804 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5805 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5806 pub uid2: [u8; 18],
5807}
5808impl AUTOPILOT_VERSION_DATA {
5809 pub const ENCODED_LEN: usize = 78usize;
5810 pub const DEFAULT: Self = Self {
5811 capabilities: MavProtocolCapability::DEFAULT,
5812 uid: 0_u64,
5813 flight_sw_version: 0_u32,
5814 middleware_sw_version: 0_u32,
5815 os_sw_version: 0_u32,
5816 board_version: 0_u32,
5817 vendor_id: 0_u16,
5818 product_id: 0_u16,
5819 flight_custom_version: [0_u8; 8usize],
5820 middleware_custom_version: [0_u8; 8usize],
5821 os_custom_version: [0_u8; 8usize],
5822 uid2: [0_u8; 18usize],
5823 };
5824 #[cfg(feature = "arbitrary")]
5825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5826 use arbitrary::{Arbitrary, Unstructured};
5827 let mut buf = [0u8; 1024];
5828 rng.fill_bytes(&mut buf);
5829 let mut unstructured = Unstructured::new(&buf);
5830 Self::arbitrary(&mut unstructured).unwrap_or_default()
5831 }
5832}
5833impl Default for AUTOPILOT_VERSION_DATA {
5834 fn default() -> Self {
5835 Self::DEFAULT.clone()
5836 }
5837}
5838impl MessageData for AUTOPILOT_VERSION_DATA {
5839 type Message = MavMessage;
5840 const ID: u32 = 148u32;
5841 const NAME: &'static str = "AUTOPILOT_VERSION";
5842 const EXTRA_CRC: u8 = 178u8;
5843 const ENCODED_LEN: usize = 78usize;
5844 fn deser(
5845 _version: MavlinkVersion,
5846 __input: &[u8],
5847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5848 let avail_len = __input.len();
5849 let mut payload_buf = [0; Self::ENCODED_LEN];
5850 let mut buf = if avail_len < Self::ENCODED_LEN {
5851 payload_buf[0..avail_len].copy_from_slice(__input);
5852 Bytes::new(&payload_buf)
5853 } else {
5854 Bytes::new(__input)
5855 };
5856 let mut __struct = Self::default();
5857 let tmp = buf.get_u64_le();
5858 __struct.capabilities = MavProtocolCapability::from_bits(
5859 tmp & MavProtocolCapability::all().bits(),
5860 )
5861 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5862 flag_type: "MavProtocolCapability",
5863 value: tmp as u32,
5864 })?;
5865 __struct.uid = buf.get_u64_le();
5866 __struct.flight_sw_version = buf.get_u32_le();
5867 __struct.middleware_sw_version = buf.get_u32_le();
5868 __struct.os_sw_version = buf.get_u32_le();
5869 __struct.board_version = buf.get_u32_le();
5870 __struct.vendor_id = buf.get_u16_le();
5871 __struct.product_id = buf.get_u16_le();
5872 for v in &mut __struct.flight_custom_version {
5873 let val = buf.get_u8();
5874 *v = val;
5875 }
5876 for v in &mut __struct.middleware_custom_version {
5877 let val = buf.get_u8();
5878 *v = val;
5879 }
5880 for v in &mut __struct.os_custom_version {
5881 let val = buf.get_u8();
5882 *v = val;
5883 }
5884 for v in &mut __struct.uid2 {
5885 let val = buf.get_u8();
5886 *v = val;
5887 }
5888 Ok(__struct)
5889 }
5890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5891 let mut __tmp = BytesMut::new(bytes);
5892 #[allow(clippy::absurd_extreme_comparisons)]
5893 #[allow(unused_comparisons)]
5894 if __tmp.remaining() < Self::ENCODED_LEN {
5895 panic!(
5896 "buffer is too small (need {} bytes, but got {})",
5897 Self::ENCODED_LEN,
5898 __tmp.remaining(),
5899 )
5900 }
5901 __tmp.put_u64_le(self.capabilities.bits());
5902 __tmp.put_u64_le(self.uid);
5903 __tmp.put_u32_le(self.flight_sw_version);
5904 __tmp.put_u32_le(self.middleware_sw_version);
5905 __tmp.put_u32_le(self.os_sw_version);
5906 __tmp.put_u32_le(self.board_version);
5907 __tmp.put_u16_le(self.vendor_id);
5908 __tmp.put_u16_le(self.product_id);
5909 for val in &self.flight_custom_version {
5910 __tmp.put_u8(*val);
5911 }
5912 for val in &self.middleware_custom_version {
5913 __tmp.put_u8(*val);
5914 }
5915 for val in &self.os_custom_version {
5916 __tmp.put_u8(*val);
5917 }
5918 for val in &self.uid2 {
5919 __tmp.put_u8(*val);
5920 }
5921 if matches!(version, MavlinkVersion::V2) {
5922 let len = __tmp.len();
5923 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5924 } else {
5925 __tmp.len()
5926 }
5927 }
5928}
5929#[doc = "id: 435"]
5930#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
5931#[derive(Debug, Clone, PartialEq)]
5932#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5933#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5934pub struct AVAILABLE_MODES_DATA {
5935 #[doc = "A bitfield for use for autopilot-specific flags"]
5936 pub custom_mode: u32,
5937 #[doc = "Mode properties."]
5938 pub properties: MavModeProperty,
5939 #[doc = "The total number of available modes for the current vehicle type."]
5940 pub number_modes: u8,
5941 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
5942 pub mode_index: u8,
5943 #[doc = "Standard mode."]
5944 pub standard_mode: MavStandardMode,
5945 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
5946 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5947 pub mode_name: [u8; 35],
5948}
5949impl AVAILABLE_MODES_DATA {
5950 pub const ENCODED_LEN: usize = 46usize;
5951 pub const DEFAULT: Self = Self {
5952 custom_mode: 0_u32,
5953 properties: MavModeProperty::DEFAULT,
5954 number_modes: 0_u8,
5955 mode_index: 0_u8,
5956 standard_mode: MavStandardMode::DEFAULT,
5957 mode_name: [0_u8; 35usize],
5958 };
5959 #[cfg(feature = "arbitrary")]
5960 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5961 use arbitrary::{Arbitrary, Unstructured};
5962 let mut buf = [0u8; 1024];
5963 rng.fill_bytes(&mut buf);
5964 let mut unstructured = Unstructured::new(&buf);
5965 Self::arbitrary(&mut unstructured).unwrap_or_default()
5966 }
5967}
5968impl Default for AVAILABLE_MODES_DATA {
5969 fn default() -> Self {
5970 Self::DEFAULT.clone()
5971 }
5972}
5973impl MessageData for AVAILABLE_MODES_DATA {
5974 type Message = MavMessage;
5975 const ID: u32 = 435u32;
5976 const NAME: &'static str = "AVAILABLE_MODES";
5977 const EXTRA_CRC: u8 = 134u8;
5978 const ENCODED_LEN: usize = 46usize;
5979 fn deser(
5980 _version: MavlinkVersion,
5981 __input: &[u8],
5982 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5983 let avail_len = __input.len();
5984 let mut payload_buf = [0; Self::ENCODED_LEN];
5985 let mut buf = if avail_len < Self::ENCODED_LEN {
5986 payload_buf[0..avail_len].copy_from_slice(__input);
5987 Bytes::new(&payload_buf)
5988 } else {
5989 Bytes::new(__input)
5990 };
5991 let mut __struct = Self::default();
5992 __struct.custom_mode = buf.get_u32_le();
5993 let tmp = buf.get_u32_le();
5994 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
5995 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5996 flag_type: "MavModeProperty",
5997 value: tmp as u32,
5998 })?;
5999 __struct.number_modes = buf.get_u8();
6000 __struct.mode_index = buf.get_u8();
6001 let tmp = buf.get_u8();
6002 __struct.standard_mode =
6003 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6004 enum_type: "MavStandardMode",
6005 value: tmp as u32,
6006 })?;
6007 for v in &mut __struct.mode_name {
6008 let val = buf.get_u8();
6009 *v = val;
6010 }
6011 Ok(__struct)
6012 }
6013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6014 let mut __tmp = BytesMut::new(bytes);
6015 #[allow(clippy::absurd_extreme_comparisons)]
6016 #[allow(unused_comparisons)]
6017 if __tmp.remaining() < Self::ENCODED_LEN {
6018 panic!(
6019 "buffer is too small (need {} bytes, but got {})",
6020 Self::ENCODED_LEN,
6021 __tmp.remaining(),
6022 )
6023 }
6024 __tmp.put_u32_le(self.custom_mode);
6025 __tmp.put_u32_le(self.properties.bits());
6026 __tmp.put_u8(self.number_modes);
6027 __tmp.put_u8(self.mode_index);
6028 __tmp.put_u8(self.standard_mode as u8);
6029 for val in &self.mode_name {
6030 __tmp.put_u8(*val);
6031 }
6032 if matches!(version, MavlinkVersion::V2) {
6033 let len = __tmp.len();
6034 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6035 } else {
6036 __tmp.len()
6037 }
6038 }
6039}
6040#[doc = "id: 437"]
6041#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6042#[derive(Debug, Clone, PartialEq)]
6043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6045pub struct AVAILABLE_MODES_MONITOR_DATA {
6046 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6047 pub seq: u8,
6048}
6049impl AVAILABLE_MODES_MONITOR_DATA {
6050 pub const ENCODED_LEN: usize = 1usize;
6051 pub const DEFAULT: Self = Self { seq: 0_u8 };
6052 #[cfg(feature = "arbitrary")]
6053 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6054 use arbitrary::{Arbitrary, Unstructured};
6055 let mut buf = [0u8; 1024];
6056 rng.fill_bytes(&mut buf);
6057 let mut unstructured = Unstructured::new(&buf);
6058 Self::arbitrary(&mut unstructured).unwrap_or_default()
6059 }
6060}
6061impl Default for AVAILABLE_MODES_MONITOR_DATA {
6062 fn default() -> Self {
6063 Self::DEFAULT.clone()
6064 }
6065}
6066impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6067 type Message = MavMessage;
6068 const ID: u32 = 437u32;
6069 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6070 const EXTRA_CRC: u8 = 30u8;
6071 const ENCODED_LEN: usize = 1usize;
6072 fn deser(
6073 _version: MavlinkVersion,
6074 __input: &[u8],
6075 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6076 let avail_len = __input.len();
6077 let mut payload_buf = [0; Self::ENCODED_LEN];
6078 let mut buf = if avail_len < Self::ENCODED_LEN {
6079 payload_buf[0..avail_len].copy_from_slice(__input);
6080 Bytes::new(&payload_buf)
6081 } else {
6082 Bytes::new(__input)
6083 };
6084 let mut __struct = Self::default();
6085 __struct.seq = buf.get_u8();
6086 Ok(__struct)
6087 }
6088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6089 let mut __tmp = BytesMut::new(bytes);
6090 #[allow(clippy::absurd_extreme_comparisons)]
6091 #[allow(unused_comparisons)]
6092 if __tmp.remaining() < Self::ENCODED_LEN {
6093 panic!(
6094 "buffer is too small (need {} bytes, but got {})",
6095 Self::ENCODED_LEN,
6096 __tmp.remaining(),
6097 )
6098 }
6099 __tmp.put_u8(self.seq);
6100 if matches!(version, MavlinkVersion::V2) {
6101 let len = __tmp.len();
6102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6103 } else {
6104 __tmp.len()
6105 }
6106 }
6107}
6108#[doc = "id: 372"]
6109#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6110#[derive(Debug, Clone, PartialEq)]
6111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6113pub struct BATTERY_INFO_DATA {
6114 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6115 pub discharge_minimum_voltage: f32,
6116 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6117 pub charging_minimum_voltage: f32,
6118 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6119 pub resting_minimum_voltage: f32,
6120 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6121 pub charging_maximum_voltage: f32,
6122 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6123 pub charging_maximum_current: f32,
6124 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6125 pub nominal_voltage: f32,
6126 #[doc = "Maximum pack discharge current. 0: field not provided."]
6127 pub discharge_maximum_current: f32,
6128 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6129 pub discharge_maximum_burst_current: f32,
6130 #[doc = "Fully charged design capacity. 0: field not provided."]
6131 pub design_capacity: f32,
6132 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6133 pub full_charge_capacity: f32,
6134 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6135 pub cycle_count: u16,
6136 #[doc = "Battery weight. 0: field not provided."]
6137 pub weight: u16,
6138 #[doc = "Battery ID"]
6139 pub id: u8,
6140 #[doc = "Function of the battery."]
6141 pub battery_function: MavBatteryFunction,
6142 #[doc = "Type (chemistry) of the battery."]
6143 pub mavtype: MavBatteryType,
6144 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6145 pub state_of_health: u8,
6146 #[doc = "Number of battery cells in series. 0: field not provided."]
6147 pub cells_in_series: u8,
6148 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6149 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6150 pub manufacture_date: [u8; 9],
6151 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6152 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6153 pub serial_number: [u8; 32],
6154 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6155 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6156 pub name: [u8; 50],
6157}
6158impl BATTERY_INFO_DATA {
6159 pub const ENCODED_LEN: usize = 140usize;
6160 pub const DEFAULT: Self = Self {
6161 discharge_minimum_voltage: 0.0_f32,
6162 charging_minimum_voltage: 0.0_f32,
6163 resting_minimum_voltage: 0.0_f32,
6164 charging_maximum_voltage: 0.0_f32,
6165 charging_maximum_current: 0.0_f32,
6166 nominal_voltage: 0.0_f32,
6167 discharge_maximum_current: 0.0_f32,
6168 discharge_maximum_burst_current: 0.0_f32,
6169 design_capacity: 0.0_f32,
6170 full_charge_capacity: 0.0_f32,
6171 cycle_count: 0_u16,
6172 weight: 0_u16,
6173 id: 0_u8,
6174 battery_function: MavBatteryFunction::DEFAULT,
6175 mavtype: MavBatteryType::DEFAULT,
6176 state_of_health: 0_u8,
6177 cells_in_series: 0_u8,
6178 manufacture_date: [0_u8; 9usize],
6179 serial_number: [0_u8; 32usize],
6180 name: [0_u8; 50usize],
6181 };
6182 #[cfg(feature = "arbitrary")]
6183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6184 use arbitrary::{Arbitrary, Unstructured};
6185 let mut buf = [0u8; 1024];
6186 rng.fill_bytes(&mut buf);
6187 let mut unstructured = Unstructured::new(&buf);
6188 Self::arbitrary(&mut unstructured).unwrap_or_default()
6189 }
6190}
6191impl Default for BATTERY_INFO_DATA {
6192 fn default() -> Self {
6193 Self::DEFAULT.clone()
6194 }
6195}
6196impl MessageData for BATTERY_INFO_DATA {
6197 type Message = MavMessage;
6198 const ID: u32 = 372u32;
6199 const NAME: &'static str = "BATTERY_INFO";
6200 const EXTRA_CRC: u8 = 26u8;
6201 const ENCODED_LEN: usize = 140usize;
6202 fn deser(
6203 _version: MavlinkVersion,
6204 __input: &[u8],
6205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6206 let avail_len = __input.len();
6207 let mut payload_buf = [0; Self::ENCODED_LEN];
6208 let mut buf = if avail_len < Self::ENCODED_LEN {
6209 payload_buf[0..avail_len].copy_from_slice(__input);
6210 Bytes::new(&payload_buf)
6211 } else {
6212 Bytes::new(__input)
6213 };
6214 let mut __struct = Self::default();
6215 __struct.discharge_minimum_voltage = buf.get_f32_le();
6216 __struct.charging_minimum_voltage = buf.get_f32_le();
6217 __struct.resting_minimum_voltage = buf.get_f32_le();
6218 __struct.charging_maximum_voltage = buf.get_f32_le();
6219 __struct.charging_maximum_current = buf.get_f32_le();
6220 __struct.nominal_voltage = buf.get_f32_le();
6221 __struct.discharge_maximum_current = buf.get_f32_le();
6222 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6223 __struct.design_capacity = buf.get_f32_le();
6224 __struct.full_charge_capacity = buf.get_f32_le();
6225 __struct.cycle_count = buf.get_u16_le();
6226 __struct.weight = buf.get_u16_le();
6227 __struct.id = buf.get_u8();
6228 let tmp = buf.get_u8();
6229 __struct.battery_function =
6230 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6231 enum_type: "MavBatteryFunction",
6232 value: tmp as u32,
6233 })?;
6234 let tmp = buf.get_u8();
6235 __struct.mavtype =
6236 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6237 enum_type: "MavBatteryType",
6238 value: tmp as u32,
6239 })?;
6240 __struct.state_of_health = buf.get_u8();
6241 __struct.cells_in_series = buf.get_u8();
6242 for v in &mut __struct.manufacture_date {
6243 let val = buf.get_u8();
6244 *v = val;
6245 }
6246 for v in &mut __struct.serial_number {
6247 let val = buf.get_u8();
6248 *v = val;
6249 }
6250 for v in &mut __struct.name {
6251 let val = buf.get_u8();
6252 *v = val;
6253 }
6254 Ok(__struct)
6255 }
6256 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6257 let mut __tmp = BytesMut::new(bytes);
6258 #[allow(clippy::absurd_extreme_comparisons)]
6259 #[allow(unused_comparisons)]
6260 if __tmp.remaining() < Self::ENCODED_LEN {
6261 panic!(
6262 "buffer is too small (need {} bytes, but got {})",
6263 Self::ENCODED_LEN,
6264 __tmp.remaining(),
6265 )
6266 }
6267 __tmp.put_f32_le(self.discharge_minimum_voltage);
6268 __tmp.put_f32_le(self.charging_minimum_voltage);
6269 __tmp.put_f32_le(self.resting_minimum_voltage);
6270 __tmp.put_f32_le(self.charging_maximum_voltage);
6271 __tmp.put_f32_le(self.charging_maximum_current);
6272 __tmp.put_f32_le(self.nominal_voltage);
6273 __tmp.put_f32_le(self.discharge_maximum_current);
6274 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6275 __tmp.put_f32_le(self.design_capacity);
6276 __tmp.put_f32_le(self.full_charge_capacity);
6277 __tmp.put_u16_le(self.cycle_count);
6278 __tmp.put_u16_le(self.weight);
6279 __tmp.put_u8(self.id);
6280 __tmp.put_u8(self.battery_function as u8);
6281 __tmp.put_u8(self.mavtype as u8);
6282 __tmp.put_u8(self.state_of_health);
6283 __tmp.put_u8(self.cells_in_series);
6284 for val in &self.manufacture_date {
6285 __tmp.put_u8(*val);
6286 }
6287 for val in &self.serial_number {
6288 __tmp.put_u8(*val);
6289 }
6290 for val in &self.name {
6291 __tmp.put_u8(*val);
6292 }
6293 if matches!(version, MavlinkVersion::V2) {
6294 let len = __tmp.len();
6295 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6296 } else {
6297 __tmp.len()
6298 }
6299 }
6300}
6301#[doc = "id: 147"]
6302#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6303#[derive(Debug, Clone, PartialEq)]
6304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6306pub struct BATTERY_STATUS_DATA {
6307 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6308 pub current_consumed: i32,
6309 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6310 pub energy_consumed: i32,
6311 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6312 pub temperature: i16,
6313 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6314 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6315 pub voltages: [u16; 10],
6316 #[doc = "Battery current, -1: autopilot does not measure the current"]
6317 pub current_battery: i16,
6318 #[doc = "Battery ID"]
6319 pub id: u8,
6320 #[doc = "Function of the battery"]
6321 pub battery_function: MavBatteryFunction,
6322 #[doc = "Type (chemistry) of the battery"]
6323 pub mavtype: MavBatteryType,
6324 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6325 pub battery_remaining: i8,
6326 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6327 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6328 pub time_remaining: i32,
6329 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6330 #[cfg_attr(feature = "serde", serde(default))]
6331 pub charge_state: MavBatteryChargeState,
6332 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6333 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6334 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6335 pub voltages_ext: [u16; 4],
6336 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6337 #[cfg_attr(feature = "serde", serde(default))]
6338 pub mode: MavBatteryMode,
6339 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6340 #[cfg_attr(feature = "serde", serde(default))]
6341 pub fault_bitmask: MavBatteryFault,
6342}
6343impl BATTERY_STATUS_DATA {
6344 pub const ENCODED_LEN: usize = 54usize;
6345 pub const DEFAULT: Self = Self {
6346 current_consumed: 0_i32,
6347 energy_consumed: 0_i32,
6348 temperature: 0_i16,
6349 voltages: [0_u16; 10usize],
6350 current_battery: 0_i16,
6351 id: 0_u8,
6352 battery_function: MavBatteryFunction::DEFAULT,
6353 mavtype: MavBatteryType::DEFAULT,
6354 battery_remaining: 0_i8,
6355 time_remaining: 0_i32,
6356 charge_state: MavBatteryChargeState::DEFAULT,
6357 voltages_ext: [0_u16; 4usize],
6358 mode: MavBatteryMode::DEFAULT,
6359 fault_bitmask: MavBatteryFault::DEFAULT,
6360 };
6361 #[cfg(feature = "arbitrary")]
6362 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6363 use arbitrary::{Arbitrary, Unstructured};
6364 let mut buf = [0u8; 1024];
6365 rng.fill_bytes(&mut buf);
6366 let mut unstructured = Unstructured::new(&buf);
6367 Self::arbitrary(&mut unstructured).unwrap_or_default()
6368 }
6369}
6370impl Default for BATTERY_STATUS_DATA {
6371 fn default() -> Self {
6372 Self::DEFAULT.clone()
6373 }
6374}
6375impl MessageData for BATTERY_STATUS_DATA {
6376 type Message = MavMessage;
6377 const ID: u32 = 147u32;
6378 const NAME: &'static str = "BATTERY_STATUS";
6379 const EXTRA_CRC: u8 = 154u8;
6380 const ENCODED_LEN: usize = 54usize;
6381 fn deser(
6382 _version: MavlinkVersion,
6383 __input: &[u8],
6384 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6385 let avail_len = __input.len();
6386 let mut payload_buf = [0; Self::ENCODED_LEN];
6387 let mut buf = if avail_len < Self::ENCODED_LEN {
6388 payload_buf[0..avail_len].copy_from_slice(__input);
6389 Bytes::new(&payload_buf)
6390 } else {
6391 Bytes::new(__input)
6392 };
6393 let mut __struct = Self::default();
6394 __struct.current_consumed = buf.get_i32_le();
6395 __struct.energy_consumed = buf.get_i32_le();
6396 __struct.temperature = buf.get_i16_le();
6397 for v in &mut __struct.voltages {
6398 let val = buf.get_u16_le();
6399 *v = val;
6400 }
6401 __struct.current_battery = buf.get_i16_le();
6402 __struct.id = buf.get_u8();
6403 let tmp = buf.get_u8();
6404 __struct.battery_function =
6405 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6406 enum_type: "MavBatteryFunction",
6407 value: tmp as u32,
6408 })?;
6409 let tmp = buf.get_u8();
6410 __struct.mavtype =
6411 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6412 enum_type: "MavBatteryType",
6413 value: tmp as u32,
6414 })?;
6415 __struct.battery_remaining = buf.get_i8();
6416 __struct.time_remaining = buf.get_i32_le();
6417 let tmp = buf.get_u8();
6418 __struct.charge_state =
6419 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6420 enum_type: "MavBatteryChargeState",
6421 value: tmp as u32,
6422 })?;
6423 for v in &mut __struct.voltages_ext {
6424 let val = buf.get_u16_le();
6425 *v = val;
6426 }
6427 let tmp = buf.get_u8();
6428 __struct.mode =
6429 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6430 enum_type: "MavBatteryMode",
6431 value: tmp as u32,
6432 })?;
6433 let tmp = buf.get_u32_le();
6434 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6435 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6436 flag_type: "MavBatteryFault",
6437 value: tmp as u32,
6438 })?;
6439 Ok(__struct)
6440 }
6441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6442 let mut __tmp = BytesMut::new(bytes);
6443 #[allow(clippy::absurd_extreme_comparisons)]
6444 #[allow(unused_comparisons)]
6445 if __tmp.remaining() < Self::ENCODED_LEN {
6446 panic!(
6447 "buffer is too small (need {} bytes, but got {})",
6448 Self::ENCODED_LEN,
6449 __tmp.remaining(),
6450 )
6451 }
6452 __tmp.put_i32_le(self.current_consumed);
6453 __tmp.put_i32_le(self.energy_consumed);
6454 __tmp.put_i16_le(self.temperature);
6455 for val in &self.voltages {
6456 __tmp.put_u16_le(*val);
6457 }
6458 __tmp.put_i16_le(self.current_battery);
6459 __tmp.put_u8(self.id);
6460 __tmp.put_u8(self.battery_function as u8);
6461 __tmp.put_u8(self.mavtype as u8);
6462 __tmp.put_i8(self.battery_remaining);
6463 __tmp.put_i32_le(self.time_remaining);
6464 __tmp.put_u8(self.charge_state as u8);
6465 for val in &self.voltages_ext {
6466 __tmp.put_u16_le(*val);
6467 }
6468 __tmp.put_u8(self.mode as u8);
6469 __tmp.put_u32_le(self.fault_bitmask.bits());
6470 if matches!(version, MavlinkVersion::V2) {
6471 let len = __tmp.len();
6472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6473 } else {
6474 __tmp.len()
6475 }
6476 }
6477}
6478#[doc = "id: 257"]
6479#[doc = "Report button state change."]
6480#[derive(Debug, Clone, PartialEq)]
6481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6483pub struct BUTTON_CHANGE_DATA {
6484 #[doc = "Timestamp (time since system boot)."]
6485 pub time_boot_ms: u32,
6486 #[doc = "Time of last change of button state."]
6487 pub last_change_ms: u32,
6488 #[doc = "Bitmap for state of buttons."]
6489 pub state: u8,
6490}
6491impl BUTTON_CHANGE_DATA {
6492 pub const ENCODED_LEN: usize = 9usize;
6493 pub const DEFAULT: Self = Self {
6494 time_boot_ms: 0_u32,
6495 last_change_ms: 0_u32,
6496 state: 0_u8,
6497 };
6498 #[cfg(feature = "arbitrary")]
6499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6500 use arbitrary::{Arbitrary, Unstructured};
6501 let mut buf = [0u8; 1024];
6502 rng.fill_bytes(&mut buf);
6503 let mut unstructured = Unstructured::new(&buf);
6504 Self::arbitrary(&mut unstructured).unwrap_or_default()
6505 }
6506}
6507impl Default for BUTTON_CHANGE_DATA {
6508 fn default() -> Self {
6509 Self::DEFAULT.clone()
6510 }
6511}
6512impl MessageData for BUTTON_CHANGE_DATA {
6513 type Message = MavMessage;
6514 const ID: u32 = 257u32;
6515 const NAME: &'static str = "BUTTON_CHANGE";
6516 const EXTRA_CRC: u8 = 131u8;
6517 const ENCODED_LEN: usize = 9usize;
6518 fn deser(
6519 _version: MavlinkVersion,
6520 __input: &[u8],
6521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6522 let avail_len = __input.len();
6523 let mut payload_buf = [0; Self::ENCODED_LEN];
6524 let mut buf = if avail_len < Self::ENCODED_LEN {
6525 payload_buf[0..avail_len].copy_from_slice(__input);
6526 Bytes::new(&payload_buf)
6527 } else {
6528 Bytes::new(__input)
6529 };
6530 let mut __struct = Self::default();
6531 __struct.time_boot_ms = buf.get_u32_le();
6532 __struct.last_change_ms = buf.get_u32_le();
6533 __struct.state = buf.get_u8();
6534 Ok(__struct)
6535 }
6536 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6537 let mut __tmp = BytesMut::new(bytes);
6538 #[allow(clippy::absurd_extreme_comparisons)]
6539 #[allow(unused_comparisons)]
6540 if __tmp.remaining() < Self::ENCODED_LEN {
6541 panic!(
6542 "buffer is too small (need {} bytes, but got {})",
6543 Self::ENCODED_LEN,
6544 __tmp.remaining(),
6545 )
6546 }
6547 __tmp.put_u32_le(self.time_boot_ms);
6548 __tmp.put_u32_le(self.last_change_ms);
6549 __tmp.put_u8(self.state);
6550 if matches!(version, MavlinkVersion::V2) {
6551 let len = __tmp.len();
6552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6553 } else {
6554 __tmp.len()
6555 }
6556 }
6557}
6558#[doc = "id: 262"]
6559#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6560#[derive(Debug, Clone, PartialEq)]
6561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6563pub struct CAMERA_CAPTURE_STATUS_DATA {
6564 #[doc = "Timestamp (time since system boot)."]
6565 pub time_boot_ms: u32,
6566 #[doc = "Image capture interval"]
6567 pub image_interval: f32,
6568 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6569 pub recording_time_ms: u32,
6570 #[doc = "Available storage capacity."]
6571 pub available_capacity: f32,
6572 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6573 pub image_status: u8,
6574 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6575 pub video_status: u8,
6576 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6577 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6578 pub image_count: i32,
6579 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6580 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6581 pub camera_device_id: u8,
6582}
6583impl CAMERA_CAPTURE_STATUS_DATA {
6584 pub const ENCODED_LEN: usize = 23usize;
6585 pub const DEFAULT: Self = Self {
6586 time_boot_ms: 0_u32,
6587 image_interval: 0.0_f32,
6588 recording_time_ms: 0_u32,
6589 available_capacity: 0.0_f32,
6590 image_status: 0_u8,
6591 video_status: 0_u8,
6592 image_count: 0_i32,
6593 camera_device_id: 0_u8,
6594 };
6595 #[cfg(feature = "arbitrary")]
6596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6597 use arbitrary::{Arbitrary, Unstructured};
6598 let mut buf = [0u8; 1024];
6599 rng.fill_bytes(&mut buf);
6600 let mut unstructured = Unstructured::new(&buf);
6601 Self::arbitrary(&mut unstructured).unwrap_or_default()
6602 }
6603}
6604impl Default for CAMERA_CAPTURE_STATUS_DATA {
6605 fn default() -> Self {
6606 Self::DEFAULT.clone()
6607 }
6608}
6609impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6610 type Message = MavMessage;
6611 const ID: u32 = 262u32;
6612 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6613 const EXTRA_CRC: u8 = 12u8;
6614 const ENCODED_LEN: usize = 23usize;
6615 fn deser(
6616 _version: MavlinkVersion,
6617 __input: &[u8],
6618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6619 let avail_len = __input.len();
6620 let mut payload_buf = [0; Self::ENCODED_LEN];
6621 let mut buf = if avail_len < Self::ENCODED_LEN {
6622 payload_buf[0..avail_len].copy_from_slice(__input);
6623 Bytes::new(&payload_buf)
6624 } else {
6625 Bytes::new(__input)
6626 };
6627 let mut __struct = Self::default();
6628 __struct.time_boot_ms = buf.get_u32_le();
6629 __struct.image_interval = buf.get_f32_le();
6630 __struct.recording_time_ms = buf.get_u32_le();
6631 __struct.available_capacity = buf.get_f32_le();
6632 __struct.image_status = buf.get_u8();
6633 __struct.video_status = buf.get_u8();
6634 __struct.image_count = buf.get_i32_le();
6635 __struct.camera_device_id = buf.get_u8();
6636 Ok(__struct)
6637 }
6638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6639 let mut __tmp = BytesMut::new(bytes);
6640 #[allow(clippy::absurd_extreme_comparisons)]
6641 #[allow(unused_comparisons)]
6642 if __tmp.remaining() < Self::ENCODED_LEN {
6643 panic!(
6644 "buffer is too small (need {} bytes, but got {})",
6645 Self::ENCODED_LEN,
6646 __tmp.remaining(),
6647 )
6648 }
6649 __tmp.put_u32_le(self.time_boot_ms);
6650 __tmp.put_f32_le(self.image_interval);
6651 __tmp.put_u32_le(self.recording_time_ms);
6652 __tmp.put_f32_le(self.available_capacity);
6653 __tmp.put_u8(self.image_status);
6654 __tmp.put_u8(self.video_status);
6655 __tmp.put_i32_le(self.image_count);
6656 __tmp.put_u8(self.camera_device_id);
6657 if matches!(version, MavlinkVersion::V2) {
6658 let len = __tmp.len();
6659 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6660 } else {
6661 __tmp.len()
6662 }
6663 }
6664}
6665#[doc = "id: 271"]
6666#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6667#[derive(Debug, Clone, PartialEq)]
6668#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6669#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6670pub struct CAMERA_FOV_STATUS_DATA {
6671 #[doc = "Timestamp (time since system boot)."]
6672 pub time_boot_ms: u32,
6673 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
6674 pub lat_camera: i32,
6675 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
6676 pub lon_camera: i32,
6677 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
6678 pub alt_camera: i32,
6679 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6680 pub lat_image: i32,
6681 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6682 pub lon_image: i32,
6683 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6684 pub alt_image: i32,
6685 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6686 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6687 pub q: [f32; 4],
6688 #[doc = "Horizontal field of view (NaN if unknown)."]
6689 pub hfov: f32,
6690 #[doc = "Vertical field of view (NaN if unknown)."]
6691 pub vfov: f32,
6692 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6693 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6694 pub camera_device_id: u8,
6695}
6696impl CAMERA_FOV_STATUS_DATA {
6697 pub const ENCODED_LEN: usize = 53usize;
6698 pub const DEFAULT: Self = Self {
6699 time_boot_ms: 0_u32,
6700 lat_camera: 0_i32,
6701 lon_camera: 0_i32,
6702 alt_camera: 0_i32,
6703 lat_image: 0_i32,
6704 lon_image: 0_i32,
6705 alt_image: 0_i32,
6706 q: [0.0_f32; 4usize],
6707 hfov: 0.0_f32,
6708 vfov: 0.0_f32,
6709 camera_device_id: 0_u8,
6710 };
6711 #[cfg(feature = "arbitrary")]
6712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6713 use arbitrary::{Arbitrary, Unstructured};
6714 let mut buf = [0u8; 1024];
6715 rng.fill_bytes(&mut buf);
6716 let mut unstructured = Unstructured::new(&buf);
6717 Self::arbitrary(&mut unstructured).unwrap_or_default()
6718 }
6719}
6720impl Default for CAMERA_FOV_STATUS_DATA {
6721 fn default() -> Self {
6722 Self::DEFAULT.clone()
6723 }
6724}
6725impl MessageData for CAMERA_FOV_STATUS_DATA {
6726 type Message = MavMessage;
6727 const ID: u32 = 271u32;
6728 const NAME: &'static str = "CAMERA_FOV_STATUS";
6729 const EXTRA_CRC: u8 = 22u8;
6730 const ENCODED_LEN: usize = 53usize;
6731 fn deser(
6732 _version: MavlinkVersion,
6733 __input: &[u8],
6734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6735 let avail_len = __input.len();
6736 let mut payload_buf = [0; Self::ENCODED_LEN];
6737 let mut buf = if avail_len < Self::ENCODED_LEN {
6738 payload_buf[0..avail_len].copy_from_slice(__input);
6739 Bytes::new(&payload_buf)
6740 } else {
6741 Bytes::new(__input)
6742 };
6743 let mut __struct = Self::default();
6744 __struct.time_boot_ms = buf.get_u32_le();
6745 __struct.lat_camera = buf.get_i32_le();
6746 __struct.lon_camera = buf.get_i32_le();
6747 __struct.alt_camera = buf.get_i32_le();
6748 __struct.lat_image = buf.get_i32_le();
6749 __struct.lon_image = buf.get_i32_le();
6750 __struct.alt_image = buf.get_i32_le();
6751 for v in &mut __struct.q {
6752 let val = buf.get_f32_le();
6753 *v = val;
6754 }
6755 __struct.hfov = buf.get_f32_le();
6756 __struct.vfov = buf.get_f32_le();
6757 __struct.camera_device_id = buf.get_u8();
6758 Ok(__struct)
6759 }
6760 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6761 let mut __tmp = BytesMut::new(bytes);
6762 #[allow(clippy::absurd_extreme_comparisons)]
6763 #[allow(unused_comparisons)]
6764 if __tmp.remaining() < Self::ENCODED_LEN {
6765 panic!(
6766 "buffer is too small (need {} bytes, but got {})",
6767 Self::ENCODED_LEN,
6768 __tmp.remaining(),
6769 )
6770 }
6771 __tmp.put_u32_le(self.time_boot_ms);
6772 __tmp.put_i32_le(self.lat_camera);
6773 __tmp.put_i32_le(self.lon_camera);
6774 __tmp.put_i32_le(self.alt_camera);
6775 __tmp.put_i32_le(self.lat_image);
6776 __tmp.put_i32_le(self.lon_image);
6777 __tmp.put_i32_le(self.alt_image);
6778 for val in &self.q {
6779 __tmp.put_f32_le(*val);
6780 }
6781 __tmp.put_f32_le(self.hfov);
6782 __tmp.put_f32_le(self.vfov);
6783 __tmp.put_u8(self.camera_device_id);
6784 if matches!(version, MavlinkVersion::V2) {
6785 let len = __tmp.len();
6786 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6787 } else {
6788 __tmp.len()
6789 }
6790 }
6791}
6792#[doc = "id: 263"]
6793#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
6794#[derive(Debug, Clone, PartialEq)]
6795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6797pub struct CAMERA_IMAGE_CAPTURED_DATA {
6798 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
6799 pub time_utc: u64,
6800 #[doc = "Timestamp (time since system boot)."]
6801 pub time_boot_ms: u32,
6802 #[doc = "Latitude where image was taken"]
6803 pub lat: i32,
6804 #[doc = "Longitude where capture was taken"]
6805 pub lon: i32,
6806 #[doc = "Altitude (MSL) where image was taken"]
6807 pub alt: i32,
6808 #[doc = "Altitude above ground"]
6809 pub relative_alt: i32,
6810 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6811 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6812 pub q: [f32; 4],
6813 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
6814 pub image_index: i32,
6815 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
6816 pub camera_id: u8,
6817 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
6818 pub capture_result: i8,
6819 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
6820 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6821 pub file_url: [u8; 205],
6822}
6823impl CAMERA_IMAGE_CAPTURED_DATA {
6824 pub const ENCODED_LEN: usize = 255usize;
6825 pub const DEFAULT: Self = Self {
6826 time_utc: 0_u64,
6827 time_boot_ms: 0_u32,
6828 lat: 0_i32,
6829 lon: 0_i32,
6830 alt: 0_i32,
6831 relative_alt: 0_i32,
6832 q: [0.0_f32; 4usize],
6833 image_index: 0_i32,
6834 camera_id: 0_u8,
6835 capture_result: 0_i8,
6836 file_url: [0_u8; 205usize],
6837 };
6838 #[cfg(feature = "arbitrary")]
6839 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6840 use arbitrary::{Arbitrary, Unstructured};
6841 let mut buf = [0u8; 1024];
6842 rng.fill_bytes(&mut buf);
6843 let mut unstructured = Unstructured::new(&buf);
6844 Self::arbitrary(&mut unstructured).unwrap_or_default()
6845 }
6846}
6847impl Default for CAMERA_IMAGE_CAPTURED_DATA {
6848 fn default() -> Self {
6849 Self::DEFAULT.clone()
6850 }
6851}
6852impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
6853 type Message = MavMessage;
6854 const ID: u32 = 263u32;
6855 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
6856 const EXTRA_CRC: u8 = 133u8;
6857 const ENCODED_LEN: usize = 255usize;
6858 fn deser(
6859 _version: MavlinkVersion,
6860 __input: &[u8],
6861 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6862 let avail_len = __input.len();
6863 let mut payload_buf = [0; Self::ENCODED_LEN];
6864 let mut buf = if avail_len < Self::ENCODED_LEN {
6865 payload_buf[0..avail_len].copy_from_slice(__input);
6866 Bytes::new(&payload_buf)
6867 } else {
6868 Bytes::new(__input)
6869 };
6870 let mut __struct = Self::default();
6871 __struct.time_utc = buf.get_u64_le();
6872 __struct.time_boot_ms = buf.get_u32_le();
6873 __struct.lat = buf.get_i32_le();
6874 __struct.lon = buf.get_i32_le();
6875 __struct.alt = buf.get_i32_le();
6876 __struct.relative_alt = buf.get_i32_le();
6877 for v in &mut __struct.q {
6878 let val = buf.get_f32_le();
6879 *v = val;
6880 }
6881 __struct.image_index = buf.get_i32_le();
6882 __struct.camera_id = buf.get_u8();
6883 __struct.capture_result = buf.get_i8();
6884 for v in &mut __struct.file_url {
6885 let val = buf.get_u8();
6886 *v = val;
6887 }
6888 Ok(__struct)
6889 }
6890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6891 let mut __tmp = BytesMut::new(bytes);
6892 #[allow(clippy::absurd_extreme_comparisons)]
6893 #[allow(unused_comparisons)]
6894 if __tmp.remaining() < Self::ENCODED_LEN {
6895 panic!(
6896 "buffer is too small (need {} bytes, but got {})",
6897 Self::ENCODED_LEN,
6898 __tmp.remaining(),
6899 )
6900 }
6901 __tmp.put_u64_le(self.time_utc);
6902 __tmp.put_u32_le(self.time_boot_ms);
6903 __tmp.put_i32_le(self.lat);
6904 __tmp.put_i32_le(self.lon);
6905 __tmp.put_i32_le(self.alt);
6906 __tmp.put_i32_le(self.relative_alt);
6907 for val in &self.q {
6908 __tmp.put_f32_le(*val);
6909 }
6910 __tmp.put_i32_le(self.image_index);
6911 __tmp.put_u8(self.camera_id);
6912 __tmp.put_i8(self.capture_result);
6913 for val in &self.file_url {
6914 __tmp.put_u8(*val);
6915 }
6916 if matches!(version, MavlinkVersion::V2) {
6917 let len = __tmp.len();
6918 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6919 } else {
6920 __tmp.len()
6921 }
6922 }
6923}
6924#[doc = "id: 259"]
6925#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6926#[derive(Debug, Clone, PartialEq)]
6927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6929pub struct CAMERA_INFORMATION_DATA {
6930 #[doc = "Timestamp (time since system boot)."]
6931 pub time_boot_ms: u32,
6932 #[doc = "0xff). Use 0 if not known."]
6933 pub firmware_version: u32,
6934 #[doc = "Focal length. Use NaN if not known."]
6935 pub focal_length: f32,
6936 #[doc = "Image sensor size horizontal. Use NaN if not known."]
6937 pub sensor_size_h: f32,
6938 #[doc = "Image sensor size vertical. Use NaN if not known."]
6939 pub sensor_size_v: f32,
6940 #[doc = "Bitmap of camera capability flags."]
6941 pub flags: CameraCapFlags,
6942 #[doc = "Horizontal image resolution. Use 0 if not known."]
6943 pub resolution_h: u16,
6944 #[doc = "Vertical image resolution. Use 0 if not known."]
6945 pub resolution_v: u16,
6946 #[doc = "Camera definition version (iteration). Use 0 if not known."]
6947 pub cam_definition_version: u16,
6948 #[doc = "Name of the camera vendor"]
6949 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6950 pub vendor_name: [u8; 32],
6951 #[doc = "Name of the camera model"]
6952 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6953 pub model_name: [u8; 32],
6954 #[doc = "Reserved for a lens ID. Use 0 if not known."]
6955 pub lens_id: u8,
6956 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
6957 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6958 pub cam_definition_uri: [u8; 140],
6959 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
6960 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6961 pub gimbal_device_id: u8,
6962 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6963 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6964 pub camera_device_id: u8,
6965}
6966impl CAMERA_INFORMATION_DATA {
6967 pub const ENCODED_LEN: usize = 237usize;
6968 pub const DEFAULT: Self = Self {
6969 time_boot_ms: 0_u32,
6970 firmware_version: 0_u32,
6971 focal_length: 0.0_f32,
6972 sensor_size_h: 0.0_f32,
6973 sensor_size_v: 0.0_f32,
6974 flags: CameraCapFlags::DEFAULT,
6975 resolution_h: 0_u16,
6976 resolution_v: 0_u16,
6977 cam_definition_version: 0_u16,
6978 vendor_name: [0_u8; 32usize],
6979 model_name: [0_u8; 32usize],
6980 lens_id: 0_u8,
6981 cam_definition_uri: [0_u8; 140usize],
6982 gimbal_device_id: 0_u8,
6983 camera_device_id: 0_u8,
6984 };
6985 #[cfg(feature = "arbitrary")]
6986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6987 use arbitrary::{Arbitrary, Unstructured};
6988 let mut buf = [0u8; 1024];
6989 rng.fill_bytes(&mut buf);
6990 let mut unstructured = Unstructured::new(&buf);
6991 Self::arbitrary(&mut unstructured).unwrap_or_default()
6992 }
6993}
6994impl Default for CAMERA_INFORMATION_DATA {
6995 fn default() -> Self {
6996 Self::DEFAULT.clone()
6997 }
6998}
6999impl MessageData for CAMERA_INFORMATION_DATA {
7000 type Message = MavMessage;
7001 const ID: u32 = 259u32;
7002 const NAME: &'static str = "CAMERA_INFORMATION";
7003 const EXTRA_CRC: u8 = 92u8;
7004 const ENCODED_LEN: usize = 237usize;
7005 fn deser(
7006 _version: MavlinkVersion,
7007 __input: &[u8],
7008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7009 let avail_len = __input.len();
7010 let mut payload_buf = [0; Self::ENCODED_LEN];
7011 let mut buf = if avail_len < Self::ENCODED_LEN {
7012 payload_buf[0..avail_len].copy_from_slice(__input);
7013 Bytes::new(&payload_buf)
7014 } else {
7015 Bytes::new(__input)
7016 };
7017 let mut __struct = Self::default();
7018 __struct.time_boot_ms = buf.get_u32_le();
7019 __struct.firmware_version = buf.get_u32_le();
7020 __struct.focal_length = buf.get_f32_le();
7021 __struct.sensor_size_h = buf.get_f32_le();
7022 __struct.sensor_size_v = buf.get_f32_le();
7023 let tmp = buf.get_u32_le();
7024 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7025 ::mavlink_core::error::ParserError::InvalidFlag {
7026 flag_type: "CameraCapFlags",
7027 value: tmp as u32,
7028 },
7029 )?;
7030 __struct.resolution_h = buf.get_u16_le();
7031 __struct.resolution_v = buf.get_u16_le();
7032 __struct.cam_definition_version = buf.get_u16_le();
7033 for v in &mut __struct.vendor_name {
7034 let val = buf.get_u8();
7035 *v = val;
7036 }
7037 for v in &mut __struct.model_name {
7038 let val = buf.get_u8();
7039 *v = val;
7040 }
7041 __struct.lens_id = buf.get_u8();
7042 for v in &mut __struct.cam_definition_uri {
7043 let val = buf.get_u8();
7044 *v = val;
7045 }
7046 __struct.gimbal_device_id = buf.get_u8();
7047 __struct.camera_device_id = buf.get_u8();
7048 Ok(__struct)
7049 }
7050 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7051 let mut __tmp = BytesMut::new(bytes);
7052 #[allow(clippy::absurd_extreme_comparisons)]
7053 #[allow(unused_comparisons)]
7054 if __tmp.remaining() < Self::ENCODED_LEN {
7055 panic!(
7056 "buffer is too small (need {} bytes, but got {})",
7057 Self::ENCODED_LEN,
7058 __tmp.remaining(),
7059 )
7060 }
7061 __tmp.put_u32_le(self.time_boot_ms);
7062 __tmp.put_u32_le(self.firmware_version);
7063 __tmp.put_f32_le(self.focal_length);
7064 __tmp.put_f32_le(self.sensor_size_h);
7065 __tmp.put_f32_le(self.sensor_size_v);
7066 __tmp.put_u32_le(self.flags.bits());
7067 __tmp.put_u16_le(self.resolution_h);
7068 __tmp.put_u16_le(self.resolution_v);
7069 __tmp.put_u16_le(self.cam_definition_version);
7070 for val in &self.vendor_name {
7071 __tmp.put_u8(*val);
7072 }
7073 for val in &self.model_name {
7074 __tmp.put_u8(*val);
7075 }
7076 __tmp.put_u8(self.lens_id);
7077 for val in &self.cam_definition_uri {
7078 __tmp.put_u8(*val);
7079 }
7080 __tmp.put_u8(self.gimbal_device_id);
7081 __tmp.put_u8(self.camera_device_id);
7082 if matches!(version, MavlinkVersion::V2) {
7083 let len = __tmp.len();
7084 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7085 } else {
7086 __tmp.len()
7087 }
7088 }
7089}
7090#[doc = "id: 260"]
7091#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7092#[derive(Debug, Clone, PartialEq)]
7093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7095pub struct CAMERA_SETTINGS_DATA {
7096 #[doc = "Timestamp (time since system boot)."]
7097 pub time_boot_ms: u32,
7098 #[doc = "Camera mode"]
7099 pub mode_id: CameraMode,
7100 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7101 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7102 pub zoomLevel: f32,
7103 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7104 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7105 pub focusLevel: f32,
7106 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7107 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7108 pub camera_device_id: u8,
7109}
7110impl CAMERA_SETTINGS_DATA {
7111 pub const ENCODED_LEN: usize = 14usize;
7112 pub const DEFAULT: Self = Self {
7113 time_boot_ms: 0_u32,
7114 mode_id: CameraMode::DEFAULT,
7115 zoomLevel: 0.0_f32,
7116 focusLevel: 0.0_f32,
7117 camera_device_id: 0_u8,
7118 };
7119 #[cfg(feature = "arbitrary")]
7120 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7121 use arbitrary::{Arbitrary, Unstructured};
7122 let mut buf = [0u8; 1024];
7123 rng.fill_bytes(&mut buf);
7124 let mut unstructured = Unstructured::new(&buf);
7125 Self::arbitrary(&mut unstructured).unwrap_or_default()
7126 }
7127}
7128impl Default for CAMERA_SETTINGS_DATA {
7129 fn default() -> Self {
7130 Self::DEFAULT.clone()
7131 }
7132}
7133impl MessageData for CAMERA_SETTINGS_DATA {
7134 type Message = MavMessage;
7135 const ID: u32 = 260u32;
7136 const NAME: &'static str = "CAMERA_SETTINGS";
7137 const EXTRA_CRC: u8 = 146u8;
7138 const ENCODED_LEN: usize = 14usize;
7139 fn deser(
7140 _version: MavlinkVersion,
7141 __input: &[u8],
7142 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7143 let avail_len = __input.len();
7144 let mut payload_buf = [0; Self::ENCODED_LEN];
7145 let mut buf = if avail_len < Self::ENCODED_LEN {
7146 payload_buf[0..avail_len].copy_from_slice(__input);
7147 Bytes::new(&payload_buf)
7148 } else {
7149 Bytes::new(__input)
7150 };
7151 let mut __struct = Self::default();
7152 __struct.time_boot_ms = buf.get_u32_le();
7153 let tmp = buf.get_u8();
7154 __struct.mode_id =
7155 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7156 enum_type: "CameraMode",
7157 value: tmp as u32,
7158 })?;
7159 __struct.zoomLevel = buf.get_f32_le();
7160 __struct.focusLevel = buf.get_f32_le();
7161 __struct.camera_device_id = buf.get_u8();
7162 Ok(__struct)
7163 }
7164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7165 let mut __tmp = BytesMut::new(bytes);
7166 #[allow(clippy::absurd_extreme_comparisons)]
7167 #[allow(unused_comparisons)]
7168 if __tmp.remaining() < Self::ENCODED_LEN {
7169 panic!(
7170 "buffer is too small (need {} bytes, but got {})",
7171 Self::ENCODED_LEN,
7172 __tmp.remaining(),
7173 )
7174 }
7175 __tmp.put_u32_le(self.time_boot_ms);
7176 __tmp.put_u8(self.mode_id as u8);
7177 __tmp.put_f32_le(self.zoomLevel);
7178 __tmp.put_f32_le(self.focusLevel);
7179 __tmp.put_u8(self.camera_device_id);
7180 if matches!(version, MavlinkVersion::V2) {
7181 let len = __tmp.len();
7182 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7183 } else {
7184 __tmp.len()
7185 }
7186 }
7187}
7188#[doc = "id: 277"]
7189#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7190#[derive(Debug, Clone, PartialEq)]
7191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7192#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7193pub struct CAMERA_THERMAL_RANGE_DATA {
7194 #[doc = "Timestamp (time since system boot)."]
7195 pub time_boot_ms: u32,
7196 #[doc = "Temperature max."]
7197 pub max: f32,
7198 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7199 pub max_point_x: f32,
7200 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7201 pub max_point_y: f32,
7202 #[doc = "Temperature min."]
7203 pub min: f32,
7204 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7205 pub min_point_x: f32,
7206 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7207 pub min_point_y: f32,
7208 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7209 pub stream_id: u8,
7210 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7211 pub camera_device_id: u8,
7212}
7213impl CAMERA_THERMAL_RANGE_DATA {
7214 pub const ENCODED_LEN: usize = 30usize;
7215 pub const DEFAULT: Self = Self {
7216 time_boot_ms: 0_u32,
7217 max: 0.0_f32,
7218 max_point_x: 0.0_f32,
7219 max_point_y: 0.0_f32,
7220 min: 0.0_f32,
7221 min_point_x: 0.0_f32,
7222 min_point_y: 0.0_f32,
7223 stream_id: 0_u8,
7224 camera_device_id: 0_u8,
7225 };
7226 #[cfg(feature = "arbitrary")]
7227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7228 use arbitrary::{Arbitrary, Unstructured};
7229 let mut buf = [0u8; 1024];
7230 rng.fill_bytes(&mut buf);
7231 let mut unstructured = Unstructured::new(&buf);
7232 Self::arbitrary(&mut unstructured).unwrap_or_default()
7233 }
7234}
7235impl Default for CAMERA_THERMAL_RANGE_DATA {
7236 fn default() -> Self {
7237 Self::DEFAULT.clone()
7238 }
7239}
7240impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7241 type Message = MavMessage;
7242 const ID: u32 = 277u32;
7243 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7244 const EXTRA_CRC: u8 = 62u8;
7245 const ENCODED_LEN: usize = 30usize;
7246 fn deser(
7247 _version: MavlinkVersion,
7248 __input: &[u8],
7249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7250 let avail_len = __input.len();
7251 let mut payload_buf = [0; Self::ENCODED_LEN];
7252 let mut buf = if avail_len < Self::ENCODED_LEN {
7253 payload_buf[0..avail_len].copy_from_slice(__input);
7254 Bytes::new(&payload_buf)
7255 } else {
7256 Bytes::new(__input)
7257 };
7258 let mut __struct = Self::default();
7259 __struct.time_boot_ms = buf.get_u32_le();
7260 __struct.max = buf.get_f32_le();
7261 __struct.max_point_x = buf.get_f32_le();
7262 __struct.max_point_y = buf.get_f32_le();
7263 __struct.min = buf.get_f32_le();
7264 __struct.min_point_x = buf.get_f32_le();
7265 __struct.min_point_y = buf.get_f32_le();
7266 __struct.stream_id = buf.get_u8();
7267 __struct.camera_device_id = buf.get_u8();
7268 Ok(__struct)
7269 }
7270 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7271 let mut __tmp = BytesMut::new(bytes);
7272 #[allow(clippy::absurd_extreme_comparisons)]
7273 #[allow(unused_comparisons)]
7274 if __tmp.remaining() < Self::ENCODED_LEN {
7275 panic!(
7276 "buffer is too small (need {} bytes, but got {})",
7277 Self::ENCODED_LEN,
7278 __tmp.remaining(),
7279 )
7280 }
7281 __tmp.put_u32_le(self.time_boot_ms);
7282 __tmp.put_f32_le(self.max);
7283 __tmp.put_f32_le(self.max_point_x);
7284 __tmp.put_f32_le(self.max_point_y);
7285 __tmp.put_f32_le(self.min);
7286 __tmp.put_f32_le(self.min_point_x);
7287 __tmp.put_f32_le(self.min_point_y);
7288 __tmp.put_u8(self.stream_id);
7289 __tmp.put_u8(self.camera_device_id);
7290 if matches!(version, MavlinkVersion::V2) {
7291 let len = __tmp.len();
7292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7293 } else {
7294 __tmp.len()
7295 }
7296 }
7297}
7298#[doc = "id: 276"]
7299#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7300#[derive(Debug, Clone, PartialEq)]
7301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7303pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7304 #[doc = "Latitude of tracked object"]
7305 pub lat: i32,
7306 #[doc = "Longitude of tracked object"]
7307 pub lon: i32,
7308 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7309 pub alt: f32,
7310 #[doc = "Horizontal accuracy. NAN if unknown"]
7311 pub h_acc: f32,
7312 #[doc = "Vertical accuracy. NAN if unknown"]
7313 pub v_acc: f32,
7314 #[doc = "North velocity of tracked object. NAN if unknown"]
7315 pub vel_n: f32,
7316 #[doc = "East velocity of tracked object. NAN if unknown"]
7317 pub vel_e: f32,
7318 #[doc = "Down velocity of tracked object. NAN if unknown"]
7319 pub vel_d: f32,
7320 #[doc = "Velocity accuracy. NAN if unknown"]
7321 pub vel_acc: f32,
7322 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7323 pub dist: f32,
7324 #[doc = "Heading in radians, in NED. NAN if unknown"]
7325 pub hdg: f32,
7326 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7327 pub hdg_acc: f32,
7328 #[doc = "Current tracking status"]
7329 pub tracking_status: CameraTrackingStatusFlags,
7330 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7331 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7332 pub camera_device_id: u8,
7333}
7334impl CAMERA_TRACKING_GEO_STATUS_DATA {
7335 pub const ENCODED_LEN: usize = 50usize;
7336 pub const DEFAULT: Self = Self {
7337 lat: 0_i32,
7338 lon: 0_i32,
7339 alt: 0.0_f32,
7340 h_acc: 0.0_f32,
7341 v_acc: 0.0_f32,
7342 vel_n: 0.0_f32,
7343 vel_e: 0.0_f32,
7344 vel_d: 0.0_f32,
7345 vel_acc: 0.0_f32,
7346 dist: 0.0_f32,
7347 hdg: 0.0_f32,
7348 hdg_acc: 0.0_f32,
7349 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7350 camera_device_id: 0_u8,
7351 };
7352 #[cfg(feature = "arbitrary")]
7353 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7354 use arbitrary::{Arbitrary, Unstructured};
7355 let mut buf = [0u8; 1024];
7356 rng.fill_bytes(&mut buf);
7357 let mut unstructured = Unstructured::new(&buf);
7358 Self::arbitrary(&mut unstructured).unwrap_or_default()
7359 }
7360}
7361impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7362 fn default() -> Self {
7363 Self::DEFAULT.clone()
7364 }
7365}
7366impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7367 type Message = MavMessage;
7368 const ID: u32 = 276u32;
7369 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7370 const EXTRA_CRC: u8 = 18u8;
7371 const ENCODED_LEN: usize = 50usize;
7372 fn deser(
7373 _version: MavlinkVersion,
7374 __input: &[u8],
7375 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7376 let avail_len = __input.len();
7377 let mut payload_buf = [0; Self::ENCODED_LEN];
7378 let mut buf = if avail_len < Self::ENCODED_LEN {
7379 payload_buf[0..avail_len].copy_from_slice(__input);
7380 Bytes::new(&payload_buf)
7381 } else {
7382 Bytes::new(__input)
7383 };
7384 let mut __struct = Self::default();
7385 __struct.lat = buf.get_i32_le();
7386 __struct.lon = buf.get_i32_le();
7387 __struct.alt = buf.get_f32_le();
7388 __struct.h_acc = buf.get_f32_le();
7389 __struct.v_acc = buf.get_f32_le();
7390 __struct.vel_n = buf.get_f32_le();
7391 __struct.vel_e = buf.get_f32_le();
7392 __struct.vel_d = buf.get_f32_le();
7393 __struct.vel_acc = buf.get_f32_le();
7394 __struct.dist = buf.get_f32_le();
7395 __struct.hdg = buf.get_f32_le();
7396 __struct.hdg_acc = buf.get_f32_le();
7397 let tmp = buf.get_u8();
7398 __struct.tracking_status =
7399 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7400 enum_type: "CameraTrackingStatusFlags",
7401 value: tmp as u32,
7402 })?;
7403 __struct.camera_device_id = buf.get_u8();
7404 Ok(__struct)
7405 }
7406 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7407 let mut __tmp = BytesMut::new(bytes);
7408 #[allow(clippy::absurd_extreme_comparisons)]
7409 #[allow(unused_comparisons)]
7410 if __tmp.remaining() < Self::ENCODED_LEN {
7411 panic!(
7412 "buffer is too small (need {} bytes, but got {})",
7413 Self::ENCODED_LEN,
7414 __tmp.remaining(),
7415 )
7416 }
7417 __tmp.put_i32_le(self.lat);
7418 __tmp.put_i32_le(self.lon);
7419 __tmp.put_f32_le(self.alt);
7420 __tmp.put_f32_le(self.h_acc);
7421 __tmp.put_f32_le(self.v_acc);
7422 __tmp.put_f32_le(self.vel_n);
7423 __tmp.put_f32_le(self.vel_e);
7424 __tmp.put_f32_le(self.vel_d);
7425 __tmp.put_f32_le(self.vel_acc);
7426 __tmp.put_f32_le(self.dist);
7427 __tmp.put_f32_le(self.hdg);
7428 __tmp.put_f32_le(self.hdg_acc);
7429 __tmp.put_u8(self.tracking_status as u8);
7430 __tmp.put_u8(self.camera_device_id);
7431 if matches!(version, MavlinkVersion::V2) {
7432 let len = __tmp.len();
7433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7434 } else {
7435 __tmp.len()
7436 }
7437 }
7438}
7439#[doc = "id: 275"]
7440#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7441#[derive(Debug, Clone, PartialEq)]
7442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7444pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7445 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7446 pub point_x: f32,
7447 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7448 pub point_y: f32,
7449 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7450 pub radius: f32,
7451 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7452 pub rec_top_x: f32,
7453 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7454 pub rec_top_y: f32,
7455 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7456 pub rec_bottom_x: f32,
7457 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7458 pub rec_bottom_y: f32,
7459 #[doc = "Current tracking status"]
7460 pub tracking_status: CameraTrackingStatusFlags,
7461 #[doc = "Current tracking mode"]
7462 pub tracking_mode: CameraTrackingMode,
7463 #[doc = "Defines location of target data"]
7464 pub target_data: CameraTrackingTargetData,
7465 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7466 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7467 pub camera_device_id: u8,
7468}
7469impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7470 pub const ENCODED_LEN: usize = 32usize;
7471 pub const DEFAULT: Self = Self {
7472 point_x: 0.0_f32,
7473 point_y: 0.0_f32,
7474 radius: 0.0_f32,
7475 rec_top_x: 0.0_f32,
7476 rec_top_y: 0.0_f32,
7477 rec_bottom_x: 0.0_f32,
7478 rec_bottom_y: 0.0_f32,
7479 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7480 tracking_mode: CameraTrackingMode::DEFAULT,
7481 target_data: CameraTrackingTargetData::DEFAULT,
7482 camera_device_id: 0_u8,
7483 };
7484 #[cfg(feature = "arbitrary")]
7485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7486 use arbitrary::{Arbitrary, Unstructured};
7487 let mut buf = [0u8; 1024];
7488 rng.fill_bytes(&mut buf);
7489 let mut unstructured = Unstructured::new(&buf);
7490 Self::arbitrary(&mut unstructured).unwrap_or_default()
7491 }
7492}
7493impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7494 fn default() -> Self {
7495 Self::DEFAULT.clone()
7496 }
7497}
7498impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7499 type Message = MavMessage;
7500 const ID: u32 = 275u32;
7501 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7502 const EXTRA_CRC: u8 = 126u8;
7503 const ENCODED_LEN: usize = 32usize;
7504 fn deser(
7505 _version: MavlinkVersion,
7506 __input: &[u8],
7507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7508 let avail_len = __input.len();
7509 let mut payload_buf = [0; Self::ENCODED_LEN];
7510 let mut buf = if avail_len < Self::ENCODED_LEN {
7511 payload_buf[0..avail_len].copy_from_slice(__input);
7512 Bytes::new(&payload_buf)
7513 } else {
7514 Bytes::new(__input)
7515 };
7516 let mut __struct = Self::default();
7517 __struct.point_x = buf.get_f32_le();
7518 __struct.point_y = buf.get_f32_le();
7519 __struct.radius = buf.get_f32_le();
7520 __struct.rec_top_x = buf.get_f32_le();
7521 __struct.rec_top_y = buf.get_f32_le();
7522 __struct.rec_bottom_x = buf.get_f32_le();
7523 __struct.rec_bottom_y = buf.get_f32_le();
7524 let tmp = buf.get_u8();
7525 __struct.tracking_status =
7526 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7527 enum_type: "CameraTrackingStatusFlags",
7528 value: tmp as u32,
7529 })?;
7530 let tmp = buf.get_u8();
7531 __struct.tracking_mode =
7532 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7533 enum_type: "CameraTrackingMode",
7534 value: tmp as u32,
7535 })?;
7536 let tmp = buf.get_u8();
7537 __struct.target_data =
7538 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7539 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7540 flag_type: "CameraTrackingTargetData",
7541 value: tmp as u32,
7542 })?;
7543 __struct.camera_device_id = buf.get_u8();
7544 Ok(__struct)
7545 }
7546 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7547 let mut __tmp = BytesMut::new(bytes);
7548 #[allow(clippy::absurd_extreme_comparisons)]
7549 #[allow(unused_comparisons)]
7550 if __tmp.remaining() < Self::ENCODED_LEN {
7551 panic!(
7552 "buffer is too small (need {} bytes, but got {})",
7553 Self::ENCODED_LEN,
7554 __tmp.remaining(),
7555 )
7556 }
7557 __tmp.put_f32_le(self.point_x);
7558 __tmp.put_f32_le(self.point_y);
7559 __tmp.put_f32_le(self.radius);
7560 __tmp.put_f32_le(self.rec_top_x);
7561 __tmp.put_f32_le(self.rec_top_y);
7562 __tmp.put_f32_le(self.rec_bottom_x);
7563 __tmp.put_f32_le(self.rec_bottom_y);
7564 __tmp.put_u8(self.tracking_status as u8);
7565 __tmp.put_u8(self.tracking_mode as u8);
7566 __tmp.put_u8(self.target_data.bits());
7567 __tmp.put_u8(self.camera_device_id);
7568 if matches!(version, MavlinkVersion::V2) {
7569 let len = __tmp.len();
7570 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7571 } else {
7572 __tmp.len()
7573 }
7574 }
7575}
7576#[doc = "id: 112"]
7577#[doc = "Camera-IMU triggering and synchronisation message."]
7578#[derive(Debug, Clone, PartialEq)]
7579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7581pub struct CAMERA_TRIGGER_DATA {
7582 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7583 pub time_usec: u64,
7584 #[doc = "Image frame sequence"]
7585 pub seq: u32,
7586}
7587impl CAMERA_TRIGGER_DATA {
7588 pub const ENCODED_LEN: usize = 12usize;
7589 pub const DEFAULT: Self = Self {
7590 time_usec: 0_u64,
7591 seq: 0_u32,
7592 };
7593 #[cfg(feature = "arbitrary")]
7594 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7595 use arbitrary::{Arbitrary, Unstructured};
7596 let mut buf = [0u8; 1024];
7597 rng.fill_bytes(&mut buf);
7598 let mut unstructured = Unstructured::new(&buf);
7599 Self::arbitrary(&mut unstructured).unwrap_or_default()
7600 }
7601}
7602impl Default for CAMERA_TRIGGER_DATA {
7603 fn default() -> Self {
7604 Self::DEFAULT.clone()
7605 }
7606}
7607impl MessageData for CAMERA_TRIGGER_DATA {
7608 type Message = MavMessage;
7609 const ID: u32 = 112u32;
7610 const NAME: &'static str = "CAMERA_TRIGGER";
7611 const EXTRA_CRC: u8 = 174u8;
7612 const ENCODED_LEN: usize = 12usize;
7613 fn deser(
7614 _version: MavlinkVersion,
7615 __input: &[u8],
7616 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7617 let avail_len = __input.len();
7618 let mut payload_buf = [0; Self::ENCODED_LEN];
7619 let mut buf = if avail_len < Self::ENCODED_LEN {
7620 payload_buf[0..avail_len].copy_from_slice(__input);
7621 Bytes::new(&payload_buf)
7622 } else {
7623 Bytes::new(__input)
7624 };
7625 let mut __struct = Self::default();
7626 __struct.time_usec = buf.get_u64_le();
7627 __struct.seq = buf.get_u32_le();
7628 Ok(__struct)
7629 }
7630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7631 let mut __tmp = BytesMut::new(bytes);
7632 #[allow(clippy::absurd_extreme_comparisons)]
7633 #[allow(unused_comparisons)]
7634 if __tmp.remaining() < Self::ENCODED_LEN {
7635 panic!(
7636 "buffer is too small (need {} bytes, but got {})",
7637 Self::ENCODED_LEN,
7638 __tmp.remaining(),
7639 )
7640 }
7641 __tmp.put_u64_le(self.time_usec);
7642 __tmp.put_u32_le(self.seq);
7643 if matches!(version, MavlinkVersion::V2) {
7644 let len = __tmp.len();
7645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7646 } else {
7647 __tmp.len()
7648 }
7649 }
7650}
7651#[doc = "id: 387"]
7652#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
7653#[derive(Debug, Clone, PartialEq)]
7654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7656pub struct CANFD_FRAME_DATA {
7657 #[doc = "Frame ID"]
7658 pub id: u32,
7659 #[doc = "System ID."]
7660 pub target_system: u8,
7661 #[doc = "Component ID."]
7662 pub target_component: u8,
7663 #[doc = "bus number"]
7664 pub bus: u8,
7665 #[doc = "Frame length"]
7666 pub len: u8,
7667 #[doc = "Frame data"]
7668 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7669 pub data: [u8; 64],
7670}
7671impl CANFD_FRAME_DATA {
7672 pub const ENCODED_LEN: usize = 72usize;
7673 pub const DEFAULT: Self = Self {
7674 id: 0_u32,
7675 target_system: 0_u8,
7676 target_component: 0_u8,
7677 bus: 0_u8,
7678 len: 0_u8,
7679 data: [0_u8; 64usize],
7680 };
7681 #[cfg(feature = "arbitrary")]
7682 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7683 use arbitrary::{Arbitrary, Unstructured};
7684 let mut buf = [0u8; 1024];
7685 rng.fill_bytes(&mut buf);
7686 let mut unstructured = Unstructured::new(&buf);
7687 Self::arbitrary(&mut unstructured).unwrap_or_default()
7688 }
7689}
7690impl Default for CANFD_FRAME_DATA {
7691 fn default() -> Self {
7692 Self::DEFAULT.clone()
7693 }
7694}
7695impl MessageData for CANFD_FRAME_DATA {
7696 type Message = MavMessage;
7697 const ID: u32 = 387u32;
7698 const NAME: &'static str = "CANFD_FRAME";
7699 const EXTRA_CRC: u8 = 4u8;
7700 const ENCODED_LEN: usize = 72usize;
7701 fn deser(
7702 _version: MavlinkVersion,
7703 __input: &[u8],
7704 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7705 let avail_len = __input.len();
7706 let mut payload_buf = [0; Self::ENCODED_LEN];
7707 let mut buf = if avail_len < Self::ENCODED_LEN {
7708 payload_buf[0..avail_len].copy_from_slice(__input);
7709 Bytes::new(&payload_buf)
7710 } else {
7711 Bytes::new(__input)
7712 };
7713 let mut __struct = Self::default();
7714 __struct.id = buf.get_u32_le();
7715 __struct.target_system = buf.get_u8();
7716 __struct.target_component = buf.get_u8();
7717 __struct.bus = buf.get_u8();
7718 __struct.len = buf.get_u8();
7719 for v in &mut __struct.data {
7720 let val = buf.get_u8();
7721 *v = val;
7722 }
7723 Ok(__struct)
7724 }
7725 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7726 let mut __tmp = BytesMut::new(bytes);
7727 #[allow(clippy::absurd_extreme_comparisons)]
7728 #[allow(unused_comparisons)]
7729 if __tmp.remaining() < Self::ENCODED_LEN {
7730 panic!(
7731 "buffer is too small (need {} bytes, but got {})",
7732 Self::ENCODED_LEN,
7733 __tmp.remaining(),
7734 )
7735 }
7736 __tmp.put_u32_le(self.id);
7737 __tmp.put_u8(self.target_system);
7738 __tmp.put_u8(self.target_component);
7739 __tmp.put_u8(self.bus);
7740 __tmp.put_u8(self.len);
7741 for val in &self.data {
7742 __tmp.put_u8(*val);
7743 }
7744 if matches!(version, MavlinkVersion::V2) {
7745 let len = __tmp.len();
7746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7747 } else {
7748 __tmp.len()
7749 }
7750 }
7751}
7752#[doc = "id: 388"]
7753#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
7754#[derive(Debug, Clone, PartialEq)]
7755#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7756#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7757pub struct CAN_FILTER_MODIFY_DATA {
7758 #[doc = "filter IDs, length num_ids"]
7759 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7760 pub ids: [u16; 16],
7761 #[doc = "System ID."]
7762 pub target_system: u8,
7763 #[doc = "Component ID."]
7764 pub target_component: u8,
7765 #[doc = "bus number"]
7766 pub bus: u8,
7767 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
7768 pub operation: CanFilterOp,
7769 #[doc = "number of IDs in filter list"]
7770 pub num_ids: u8,
7771}
7772impl CAN_FILTER_MODIFY_DATA {
7773 pub const ENCODED_LEN: usize = 37usize;
7774 pub const DEFAULT: Self = Self {
7775 ids: [0_u16; 16usize],
7776 target_system: 0_u8,
7777 target_component: 0_u8,
7778 bus: 0_u8,
7779 operation: CanFilterOp::DEFAULT,
7780 num_ids: 0_u8,
7781 };
7782 #[cfg(feature = "arbitrary")]
7783 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7784 use arbitrary::{Arbitrary, Unstructured};
7785 let mut buf = [0u8; 1024];
7786 rng.fill_bytes(&mut buf);
7787 let mut unstructured = Unstructured::new(&buf);
7788 Self::arbitrary(&mut unstructured).unwrap_or_default()
7789 }
7790}
7791impl Default for CAN_FILTER_MODIFY_DATA {
7792 fn default() -> Self {
7793 Self::DEFAULT.clone()
7794 }
7795}
7796impl MessageData for CAN_FILTER_MODIFY_DATA {
7797 type Message = MavMessage;
7798 const ID: u32 = 388u32;
7799 const NAME: &'static str = "CAN_FILTER_MODIFY";
7800 const EXTRA_CRC: u8 = 8u8;
7801 const ENCODED_LEN: usize = 37usize;
7802 fn deser(
7803 _version: MavlinkVersion,
7804 __input: &[u8],
7805 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7806 let avail_len = __input.len();
7807 let mut payload_buf = [0; Self::ENCODED_LEN];
7808 let mut buf = if avail_len < Self::ENCODED_LEN {
7809 payload_buf[0..avail_len].copy_from_slice(__input);
7810 Bytes::new(&payload_buf)
7811 } else {
7812 Bytes::new(__input)
7813 };
7814 let mut __struct = Self::default();
7815 for v in &mut __struct.ids {
7816 let val = buf.get_u16_le();
7817 *v = val;
7818 }
7819 __struct.target_system = buf.get_u8();
7820 __struct.target_component = buf.get_u8();
7821 __struct.bus = buf.get_u8();
7822 let tmp = buf.get_u8();
7823 __struct.operation =
7824 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7825 enum_type: "CanFilterOp",
7826 value: tmp as u32,
7827 })?;
7828 __struct.num_ids = buf.get_u8();
7829 Ok(__struct)
7830 }
7831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7832 let mut __tmp = BytesMut::new(bytes);
7833 #[allow(clippy::absurd_extreme_comparisons)]
7834 #[allow(unused_comparisons)]
7835 if __tmp.remaining() < Self::ENCODED_LEN {
7836 panic!(
7837 "buffer is too small (need {} bytes, but got {})",
7838 Self::ENCODED_LEN,
7839 __tmp.remaining(),
7840 )
7841 }
7842 for val in &self.ids {
7843 __tmp.put_u16_le(*val);
7844 }
7845 __tmp.put_u8(self.target_system);
7846 __tmp.put_u8(self.target_component);
7847 __tmp.put_u8(self.bus);
7848 __tmp.put_u8(self.operation as u8);
7849 __tmp.put_u8(self.num_ids);
7850 if matches!(version, MavlinkVersion::V2) {
7851 let len = __tmp.len();
7852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7853 } else {
7854 __tmp.len()
7855 }
7856 }
7857}
7858#[doc = "id: 386"]
7859#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
7860#[derive(Debug, Clone, PartialEq)]
7861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7862#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7863pub struct CAN_FRAME_DATA {
7864 #[doc = "Frame ID"]
7865 pub id: u32,
7866 #[doc = "System ID."]
7867 pub target_system: u8,
7868 #[doc = "Component ID."]
7869 pub target_component: u8,
7870 #[doc = "Bus number"]
7871 pub bus: u8,
7872 #[doc = "Frame length"]
7873 pub len: u8,
7874 #[doc = "Frame data"]
7875 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7876 pub data: [u8; 8],
7877}
7878impl CAN_FRAME_DATA {
7879 pub const ENCODED_LEN: usize = 16usize;
7880 pub const DEFAULT: Self = Self {
7881 id: 0_u32,
7882 target_system: 0_u8,
7883 target_component: 0_u8,
7884 bus: 0_u8,
7885 len: 0_u8,
7886 data: [0_u8; 8usize],
7887 };
7888 #[cfg(feature = "arbitrary")]
7889 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7890 use arbitrary::{Arbitrary, Unstructured};
7891 let mut buf = [0u8; 1024];
7892 rng.fill_bytes(&mut buf);
7893 let mut unstructured = Unstructured::new(&buf);
7894 Self::arbitrary(&mut unstructured).unwrap_or_default()
7895 }
7896}
7897impl Default for CAN_FRAME_DATA {
7898 fn default() -> Self {
7899 Self::DEFAULT.clone()
7900 }
7901}
7902impl MessageData for CAN_FRAME_DATA {
7903 type Message = MavMessage;
7904 const ID: u32 = 386u32;
7905 const NAME: &'static str = "CAN_FRAME";
7906 const EXTRA_CRC: u8 = 132u8;
7907 const ENCODED_LEN: usize = 16usize;
7908 fn deser(
7909 _version: MavlinkVersion,
7910 __input: &[u8],
7911 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7912 let avail_len = __input.len();
7913 let mut payload_buf = [0; Self::ENCODED_LEN];
7914 let mut buf = if avail_len < Self::ENCODED_LEN {
7915 payload_buf[0..avail_len].copy_from_slice(__input);
7916 Bytes::new(&payload_buf)
7917 } else {
7918 Bytes::new(__input)
7919 };
7920 let mut __struct = Self::default();
7921 __struct.id = buf.get_u32_le();
7922 __struct.target_system = buf.get_u8();
7923 __struct.target_component = buf.get_u8();
7924 __struct.bus = buf.get_u8();
7925 __struct.len = buf.get_u8();
7926 for v in &mut __struct.data {
7927 let val = buf.get_u8();
7928 *v = val;
7929 }
7930 Ok(__struct)
7931 }
7932 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7933 let mut __tmp = BytesMut::new(bytes);
7934 #[allow(clippy::absurd_extreme_comparisons)]
7935 #[allow(unused_comparisons)]
7936 if __tmp.remaining() < Self::ENCODED_LEN {
7937 panic!(
7938 "buffer is too small (need {} bytes, but got {})",
7939 Self::ENCODED_LEN,
7940 __tmp.remaining(),
7941 )
7942 }
7943 __tmp.put_u32_le(self.id);
7944 __tmp.put_u8(self.target_system);
7945 __tmp.put_u8(self.target_component);
7946 __tmp.put_u8(self.bus);
7947 __tmp.put_u8(self.len);
7948 for val in &self.data {
7949 __tmp.put_u8(*val);
7950 }
7951 if matches!(version, MavlinkVersion::V2) {
7952 let len = __tmp.len();
7953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7954 } else {
7955 __tmp.len()
7956 }
7957 }
7958}
7959#[doc = "id: 336"]
7960#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
7961#[derive(Debug, Clone, PartialEq)]
7962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7964pub struct CELLULAR_CONFIG_DATA {
7965 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
7966 pub enable_lte: u8,
7967 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
7968 pub enable_pin: u8,
7969 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
7970 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7971 pub pin: [u8; 16],
7972 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
7973 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7974 pub new_pin: [u8; 16],
7975 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
7976 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7977 pub apn: [u8; 32],
7978 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
7979 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7980 pub puk: [u8; 16],
7981 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
7982 pub roaming: u8,
7983 #[doc = "Message acceptance response (sent back to GS)."]
7984 pub response: CellularConfigResponse,
7985}
7986impl CELLULAR_CONFIG_DATA {
7987 pub const ENCODED_LEN: usize = 84usize;
7988 pub const DEFAULT: Self = Self {
7989 enable_lte: 0_u8,
7990 enable_pin: 0_u8,
7991 pin: [0_u8; 16usize],
7992 new_pin: [0_u8; 16usize],
7993 apn: [0_u8; 32usize],
7994 puk: [0_u8; 16usize],
7995 roaming: 0_u8,
7996 response: CellularConfigResponse::DEFAULT,
7997 };
7998 #[cfg(feature = "arbitrary")]
7999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8000 use arbitrary::{Arbitrary, Unstructured};
8001 let mut buf = [0u8; 1024];
8002 rng.fill_bytes(&mut buf);
8003 let mut unstructured = Unstructured::new(&buf);
8004 Self::arbitrary(&mut unstructured).unwrap_or_default()
8005 }
8006}
8007impl Default for CELLULAR_CONFIG_DATA {
8008 fn default() -> Self {
8009 Self::DEFAULT.clone()
8010 }
8011}
8012impl MessageData for CELLULAR_CONFIG_DATA {
8013 type Message = MavMessage;
8014 const ID: u32 = 336u32;
8015 const NAME: &'static str = "CELLULAR_CONFIG";
8016 const EXTRA_CRC: u8 = 245u8;
8017 const ENCODED_LEN: usize = 84usize;
8018 fn deser(
8019 _version: MavlinkVersion,
8020 __input: &[u8],
8021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8022 let avail_len = __input.len();
8023 let mut payload_buf = [0; Self::ENCODED_LEN];
8024 let mut buf = if avail_len < Self::ENCODED_LEN {
8025 payload_buf[0..avail_len].copy_from_slice(__input);
8026 Bytes::new(&payload_buf)
8027 } else {
8028 Bytes::new(__input)
8029 };
8030 let mut __struct = Self::default();
8031 __struct.enable_lte = buf.get_u8();
8032 __struct.enable_pin = buf.get_u8();
8033 for v in &mut __struct.pin {
8034 let val = buf.get_u8();
8035 *v = val;
8036 }
8037 for v in &mut __struct.new_pin {
8038 let val = buf.get_u8();
8039 *v = val;
8040 }
8041 for v in &mut __struct.apn {
8042 let val = buf.get_u8();
8043 *v = val;
8044 }
8045 for v in &mut __struct.puk {
8046 let val = buf.get_u8();
8047 *v = val;
8048 }
8049 __struct.roaming = buf.get_u8();
8050 let tmp = buf.get_u8();
8051 __struct.response =
8052 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8053 enum_type: "CellularConfigResponse",
8054 value: tmp as u32,
8055 })?;
8056 Ok(__struct)
8057 }
8058 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8059 let mut __tmp = BytesMut::new(bytes);
8060 #[allow(clippy::absurd_extreme_comparisons)]
8061 #[allow(unused_comparisons)]
8062 if __tmp.remaining() < Self::ENCODED_LEN {
8063 panic!(
8064 "buffer is too small (need {} bytes, but got {})",
8065 Self::ENCODED_LEN,
8066 __tmp.remaining(),
8067 )
8068 }
8069 __tmp.put_u8(self.enable_lte);
8070 __tmp.put_u8(self.enable_pin);
8071 for val in &self.pin {
8072 __tmp.put_u8(*val);
8073 }
8074 for val in &self.new_pin {
8075 __tmp.put_u8(*val);
8076 }
8077 for val in &self.apn {
8078 __tmp.put_u8(*val);
8079 }
8080 for val in &self.puk {
8081 __tmp.put_u8(*val);
8082 }
8083 __tmp.put_u8(self.roaming);
8084 __tmp.put_u8(self.response as u8);
8085 if matches!(version, MavlinkVersion::V2) {
8086 let len = __tmp.len();
8087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8088 } else {
8089 __tmp.len()
8090 }
8091 }
8092}
8093#[doc = "id: 334"]
8094#[doc = "Report current used cellular network status."]
8095#[derive(Debug, Clone, PartialEq)]
8096#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8097#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8098pub struct CELLULAR_STATUS_DATA {
8099 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8100 pub mcc: u16,
8101 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8102 pub mnc: u16,
8103 #[doc = "Location area code. If unknown, set to 0"]
8104 pub lac: u16,
8105 #[doc = "Cellular modem status"]
8106 pub status: CellularStatusFlag,
8107 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8108 pub failure_reason: CellularNetworkFailedReason,
8109 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8110 pub mavtype: CellularNetworkRadioType,
8111 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8112 pub quality: u8,
8113}
8114impl CELLULAR_STATUS_DATA {
8115 pub const ENCODED_LEN: usize = 10usize;
8116 pub const DEFAULT: Self = Self {
8117 mcc: 0_u16,
8118 mnc: 0_u16,
8119 lac: 0_u16,
8120 status: CellularStatusFlag::DEFAULT,
8121 failure_reason: CellularNetworkFailedReason::DEFAULT,
8122 mavtype: CellularNetworkRadioType::DEFAULT,
8123 quality: 0_u8,
8124 };
8125 #[cfg(feature = "arbitrary")]
8126 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8127 use arbitrary::{Arbitrary, Unstructured};
8128 let mut buf = [0u8; 1024];
8129 rng.fill_bytes(&mut buf);
8130 let mut unstructured = Unstructured::new(&buf);
8131 Self::arbitrary(&mut unstructured).unwrap_or_default()
8132 }
8133}
8134impl Default for CELLULAR_STATUS_DATA {
8135 fn default() -> Self {
8136 Self::DEFAULT.clone()
8137 }
8138}
8139impl MessageData for CELLULAR_STATUS_DATA {
8140 type Message = MavMessage;
8141 const ID: u32 = 334u32;
8142 const NAME: &'static str = "CELLULAR_STATUS";
8143 const EXTRA_CRC: u8 = 72u8;
8144 const ENCODED_LEN: usize = 10usize;
8145 fn deser(
8146 _version: MavlinkVersion,
8147 __input: &[u8],
8148 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8149 let avail_len = __input.len();
8150 let mut payload_buf = [0; Self::ENCODED_LEN];
8151 let mut buf = if avail_len < Self::ENCODED_LEN {
8152 payload_buf[0..avail_len].copy_from_slice(__input);
8153 Bytes::new(&payload_buf)
8154 } else {
8155 Bytes::new(__input)
8156 };
8157 let mut __struct = Self::default();
8158 __struct.mcc = buf.get_u16_le();
8159 __struct.mnc = buf.get_u16_le();
8160 __struct.lac = buf.get_u16_le();
8161 let tmp = buf.get_u8();
8162 __struct.status =
8163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8164 enum_type: "CellularStatusFlag",
8165 value: tmp as u32,
8166 })?;
8167 let tmp = buf.get_u8();
8168 __struct.failure_reason =
8169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8170 enum_type: "CellularNetworkFailedReason",
8171 value: tmp as u32,
8172 })?;
8173 let tmp = buf.get_u8();
8174 __struct.mavtype =
8175 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8176 enum_type: "CellularNetworkRadioType",
8177 value: tmp as u32,
8178 })?;
8179 __struct.quality = buf.get_u8();
8180 Ok(__struct)
8181 }
8182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8183 let mut __tmp = BytesMut::new(bytes);
8184 #[allow(clippy::absurd_extreme_comparisons)]
8185 #[allow(unused_comparisons)]
8186 if __tmp.remaining() < Self::ENCODED_LEN {
8187 panic!(
8188 "buffer is too small (need {} bytes, but got {})",
8189 Self::ENCODED_LEN,
8190 __tmp.remaining(),
8191 )
8192 }
8193 __tmp.put_u16_le(self.mcc);
8194 __tmp.put_u16_le(self.mnc);
8195 __tmp.put_u16_le(self.lac);
8196 __tmp.put_u8(self.status as u8);
8197 __tmp.put_u8(self.failure_reason as u8);
8198 __tmp.put_u8(self.mavtype as u8);
8199 __tmp.put_u8(self.quality);
8200 if matches!(version, MavlinkVersion::V2) {
8201 let len = __tmp.len();
8202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8203 } else {
8204 __tmp.len()
8205 }
8206 }
8207}
8208#[doc = "id: 5"]
8209#[doc = "Request to control this MAV."]
8210#[derive(Debug, Clone, PartialEq)]
8211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8213pub struct CHANGE_OPERATOR_CONTROL_DATA {
8214 #[doc = "System the GCS requests control for"]
8215 pub target_system: u8,
8216 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8217 pub control_request: u8,
8218 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8219 pub version: u8,
8220 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8221 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8222 pub passkey: [u8; 25],
8223}
8224impl CHANGE_OPERATOR_CONTROL_DATA {
8225 pub const ENCODED_LEN: usize = 28usize;
8226 pub const DEFAULT: Self = Self {
8227 target_system: 0_u8,
8228 control_request: 0_u8,
8229 version: 0_u8,
8230 passkey: [0_u8; 25usize],
8231 };
8232 #[cfg(feature = "arbitrary")]
8233 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8234 use arbitrary::{Arbitrary, Unstructured};
8235 let mut buf = [0u8; 1024];
8236 rng.fill_bytes(&mut buf);
8237 let mut unstructured = Unstructured::new(&buf);
8238 Self::arbitrary(&mut unstructured).unwrap_or_default()
8239 }
8240}
8241impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8242 fn default() -> Self {
8243 Self::DEFAULT.clone()
8244 }
8245}
8246impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8247 type Message = MavMessage;
8248 const ID: u32 = 5u32;
8249 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8250 const EXTRA_CRC: u8 = 217u8;
8251 const ENCODED_LEN: usize = 28usize;
8252 fn deser(
8253 _version: MavlinkVersion,
8254 __input: &[u8],
8255 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8256 let avail_len = __input.len();
8257 let mut payload_buf = [0; Self::ENCODED_LEN];
8258 let mut buf = if avail_len < Self::ENCODED_LEN {
8259 payload_buf[0..avail_len].copy_from_slice(__input);
8260 Bytes::new(&payload_buf)
8261 } else {
8262 Bytes::new(__input)
8263 };
8264 let mut __struct = Self::default();
8265 __struct.target_system = buf.get_u8();
8266 __struct.control_request = buf.get_u8();
8267 __struct.version = buf.get_u8();
8268 for v in &mut __struct.passkey {
8269 let val = buf.get_u8();
8270 *v = val;
8271 }
8272 Ok(__struct)
8273 }
8274 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8275 let mut __tmp = BytesMut::new(bytes);
8276 #[allow(clippy::absurd_extreme_comparisons)]
8277 #[allow(unused_comparisons)]
8278 if __tmp.remaining() < Self::ENCODED_LEN {
8279 panic!(
8280 "buffer is too small (need {} bytes, but got {})",
8281 Self::ENCODED_LEN,
8282 __tmp.remaining(),
8283 )
8284 }
8285 __tmp.put_u8(self.target_system);
8286 __tmp.put_u8(self.control_request);
8287 __tmp.put_u8(self.version);
8288 for val in &self.passkey {
8289 __tmp.put_u8(*val);
8290 }
8291 if matches!(version, MavlinkVersion::V2) {
8292 let len = __tmp.len();
8293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8294 } else {
8295 __tmp.len()
8296 }
8297 }
8298}
8299#[doc = "id: 6"]
8300#[doc = "Accept / deny control of this MAV."]
8301#[derive(Debug, Clone, PartialEq)]
8302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8304pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8305 #[doc = "ID of the GCS this message"]
8306 pub gcs_system_id: u8,
8307 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8308 pub control_request: u8,
8309 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8310 pub ack: u8,
8311}
8312impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8313 pub const ENCODED_LEN: usize = 3usize;
8314 pub const DEFAULT: Self = Self {
8315 gcs_system_id: 0_u8,
8316 control_request: 0_u8,
8317 ack: 0_u8,
8318 };
8319 #[cfg(feature = "arbitrary")]
8320 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8321 use arbitrary::{Arbitrary, Unstructured};
8322 let mut buf = [0u8; 1024];
8323 rng.fill_bytes(&mut buf);
8324 let mut unstructured = Unstructured::new(&buf);
8325 Self::arbitrary(&mut unstructured).unwrap_or_default()
8326 }
8327}
8328impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8329 fn default() -> Self {
8330 Self::DEFAULT.clone()
8331 }
8332}
8333impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8334 type Message = MavMessage;
8335 const ID: u32 = 6u32;
8336 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8337 const EXTRA_CRC: u8 = 104u8;
8338 const ENCODED_LEN: usize = 3usize;
8339 fn deser(
8340 _version: MavlinkVersion,
8341 __input: &[u8],
8342 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8343 let avail_len = __input.len();
8344 let mut payload_buf = [0; Self::ENCODED_LEN];
8345 let mut buf = if avail_len < Self::ENCODED_LEN {
8346 payload_buf[0..avail_len].copy_from_slice(__input);
8347 Bytes::new(&payload_buf)
8348 } else {
8349 Bytes::new(__input)
8350 };
8351 let mut __struct = Self::default();
8352 __struct.gcs_system_id = buf.get_u8();
8353 __struct.control_request = buf.get_u8();
8354 __struct.ack = buf.get_u8();
8355 Ok(__struct)
8356 }
8357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8358 let mut __tmp = BytesMut::new(bytes);
8359 #[allow(clippy::absurd_extreme_comparisons)]
8360 #[allow(unused_comparisons)]
8361 if __tmp.remaining() < Self::ENCODED_LEN {
8362 panic!(
8363 "buffer is too small (need {} bytes, but got {})",
8364 Self::ENCODED_LEN,
8365 __tmp.remaining(),
8366 )
8367 }
8368 __tmp.put_u8(self.gcs_system_id);
8369 __tmp.put_u8(self.control_request);
8370 __tmp.put_u8(self.ack);
8371 if matches!(version, MavlinkVersion::V2) {
8372 let len = __tmp.len();
8373 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8374 } else {
8375 __tmp.len()
8376 }
8377 }
8378}
8379#[doc = "id: 247"]
8380#[doc = "Information about a potential collision."]
8381#[derive(Debug, Clone, PartialEq)]
8382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8384pub struct COLLISION_DATA {
8385 #[doc = "Unique identifier, domain based on src field"]
8386 pub id: u32,
8387 #[doc = "Estimated time until collision occurs"]
8388 pub time_to_minimum_delta: f32,
8389 #[doc = "Closest vertical distance between vehicle and object"]
8390 pub altitude_minimum_delta: f32,
8391 #[doc = "Closest horizontal distance between vehicle and object"]
8392 pub horizontal_minimum_delta: f32,
8393 #[doc = "Collision data source"]
8394 pub src: MavCollisionSrc,
8395 #[doc = "Action that is being taken to avoid this collision"]
8396 pub action: MavCollisionAction,
8397 #[doc = "How concerned the aircraft is about this collision"]
8398 pub threat_level: MavCollisionThreatLevel,
8399}
8400impl COLLISION_DATA {
8401 pub const ENCODED_LEN: usize = 19usize;
8402 pub const DEFAULT: Self = Self {
8403 id: 0_u32,
8404 time_to_minimum_delta: 0.0_f32,
8405 altitude_minimum_delta: 0.0_f32,
8406 horizontal_minimum_delta: 0.0_f32,
8407 src: MavCollisionSrc::DEFAULT,
8408 action: MavCollisionAction::DEFAULT,
8409 threat_level: MavCollisionThreatLevel::DEFAULT,
8410 };
8411 #[cfg(feature = "arbitrary")]
8412 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8413 use arbitrary::{Arbitrary, Unstructured};
8414 let mut buf = [0u8; 1024];
8415 rng.fill_bytes(&mut buf);
8416 let mut unstructured = Unstructured::new(&buf);
8417 Self::arbitrary(&mut unstructured).unwrap_or_default()
8418 }
8419}
8420impl Default for COLLISION_DATA {
8421 fn default() -> Self {
8422 Self::DEFAULT.clone()
8423 }
8424}
8425impl MessageData for COLLISION_DATA {
8426 type Message = MavMessage;
8427 const ID: u32 = 247u32;
8428 const NAME: &'static str = "COLLISION";
8429 const EXTRA_CRC: u8 = 81u8;
8430 const ENCODED_LEN: usize = 19usize;
8431 fn deser(
8432 _version: MavlinkVersion,
8433 __input: &[u8],
8434 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8435 let avail_len = __input.len();
8436 let mut payload_buf = [0; Self::ENCODED_LEN];
8437 let mut buf = if avail_len < Self::ENCODED_LEN {
8438 payload_buf[0..avail_len].copy_from_slice(__input);
8439 Bytes::new(&payload_buf)
8440 } else {
8441 Bytes::new(__input)
8442 };
8443 let mut __struct = Self::default();
8444 __struct.id = buf.get_u32_le();
8445 __struct.time_to_minimum_delta = buf.get_f32_le();
8446 __struct.altitude_minimum_delta = buf.get_f32_le();
8447 __struct.horizontal_minimum_delta = buf.get_f32_le();
8448 let tmp = buf.get_u8();
8449 __struct.src =
8450 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8451 enum_type: "MavCollisionSrc",
8452 value: tmp as u32,
8453 })?;
8454 let tmp = buf.get_u8();
8455 __struct.action =
8456 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8457 enum_type: "MavCollisionAction",
8458 value: tmp as u32,
8459 })?;
8460 let tmp = buf.get_u8();
8461 __struct.threat_level =
8462 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8463 enum_type: "MavCollisionThreatLevel",
8464 value: tmp as u32,
8465 })?;
8466 Ok(__struct)
8467 }
8468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8469 let mut __tmp = BytesMut::new(bytes);
8470 #[allow(clippy::absurd_extreme_comparisons)]
8471 #[allow(unused_comparisons)]
8472 if __tmp.remaining() < Self::ENCODED_LEN {
8473 panic!(
8474 "buffer is too small (need {} bytes, but got {})",
8475 Self::ENCODED_LEN,
8476 __tmp.remaining(),
8477 )
8478 }
8479 __tmp.put_u32_le(self.id);
8480 __tmp.put_f32_le(self.time_to_minimum_delta);
8481 __tmp.put_f32_le(self.altitude_minimum_delta);
8482 __tmp.put_f32_le(self.horizontal_minimum_delta);
8483 __tmp.put_u8(self.src as u8);
8484 __tmp.put_u8(self.action as u8);
8485 __tmp.put_u8(self.threat_level as u8);
8486 if matches!(version, MavlinkVersion::V2) {
8487 let len = __tmp.len();
8488 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8489 } else {
8490 __tmp.len()
8491 }
8492 }
8493}
8494#[doc = "id: 77"]
8495#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8496#[derive(Debug, Clone, PartialEq)]
8497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8499pub struct COMMAND_ACK_DATA {
8500 #[doc = "Command ID (of acknowledged command)."]
8501 pub command: MavCmd,
8502 #[doc = "Result of command."]
8503 pub result: MavResult,
8504 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8505 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8506 pub progress: u8,
8507 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8508 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8509 pub result_param2: i32,
8510 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8511 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8512 pub target_system: u8,
8513 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8514 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8515 pub target_component: u8,
8516}
8517impl COMMAND_ACK_DATA {
8518 pub const ENCODED_LEN: usize = 10usize;
8519 pub const DEFAULT: Self = Self {
8520 command: MavCmd::DEFAULT,
8521 result: MavResult::DEFAULT,
8522 progress: 0_u8,
8523 result_param2: 0_i32,
8524 target_system: 0_u8,
8525 target_component: 0_u8,
8526 };
8527 #[cfg(feature = "arbitrary")]
8528 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8529 use arbitrary::{Arbitrary, Unstructured};
8530 let mut buf = [0u8; 1024];
8531 rng.fill_bytes(&mut buf);
8532 let mut unstructured = Unstructured::new(&buf);
8533 Self::arbitrary(&mut unstructured).unwrap_or_default()
8534 }
8535}
8536impl Default for COMMAND_ACK_DATA {
8537 fn default() -> Self {
8538 Self::DEFAULT.clone()
8539 }
8540}
8541impl MessageData for COMMAND_ACK_DATA {
8542 type Message = MavMessage;
8543 const ID: u32 = 77u32;
8544 const NAME: &'static str = "COMMAND_ACK";
8545 const EXTRA_CRC: u8 = 143u8;
8546 const ENCODED_LEN: usize = 10usize;
8547 fn deser(
8548 _version: MavlinkVersion,
8549 __input: &[u8],
8550 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8551 let avail_len = __input.len();
8552 let mut payload_buf = [0; Self::ENCODED_LEN];
8553 let mut buf = if avail_len < Self::ENCODED_LEN {
8554 payload_buf[0..avail_len].copy_from_slice(__input);
8555 Bytes::new(&payload_buf)
8556 } else {
8557 Bytes::new(__input)
8558 };
8559 let mut __struct = Self::default();
8560 let tmp = buf.get_u16_le();
8561 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8562 ::mavlink_core::error::ParserError::InvalidEnum {
8563 enum_type: "MavCmd",
8564 value: tmp as u32,
8565 },
8566 )?;
8567 let tmp = buf.get_u8();
8568 __struct.result =
8569 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8570 enum_type: "MavResult",
8571 value: tmp as u32,
8572 })?;
8573 __struct.progress = buf.get_u8();
8574 __struct.result_param2 = buf.get_i32_le();
8575 __struct.target_system = buf.get_u8();
8576 __struct.target_component = buf.get_u8();
8577 Ok(__struct)
8578 }
8579 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8580 let mut __tmp = BytesMut::new(bytes);
8581 #[allow(clippy::absurd_extreme_comparisons)]
8582 #[allow(unused_comparisons)]
8583 if __tmp.remaining() < Self::ENCODED_LEN {
8584 panic!(
8585 "buffer is too small (need {} bytes, but got {})",
8586 Self::ENCODED_LEN,
8587 __tmp.remaining(),
8588 )
8589 }
8590 __tmp.put_u16_le(self.command as u16);
8591 __tmp.put_u8(self.result as u8);
8592 __tmp.put_u8(self.progress);
8593 __tmp.put_i32_le(self.result_param2);
8594 __tmp.put_u8(self.target_system);
8595 __tmp.put_u8(self.target_component);
8596 if matches!(version, MavlinkVersion::V2) {
8597 let len = __tmp.len();
8598 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8599 } else {
8600 __tmp.len()
8601 }
8602 }
8603}
8604#[doc = "id: 80"]
8605#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8606#[derive(Debug, Clone, PartialEq)]
8607#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8609pub struct COMMAND_CANCEL_DATA {
8610 #[doc = "Command ID (of command to cancel)."]
8611 pub command: MavCmd,
8612 #[doc = "System executing long running command. Should not be broadcast (0)."]
8613 pub target_system: u8,
8614 #[doc = "Component executing long running command."]
8615 pub target_component: u8,
8616}
8617impl COMMAND_CANCEL_DATA {
8618 pub const ENCODED_LEN: usize = 4usize;
8619 pub const DEFAULT: Self = Self {
8620 command: MavCmd::DEFAULT,
8621 target_system: 0_u8,
8622 target_component: 0_u8,
8623 };
8624 #[cfg(feature = "arbitrary")]
8625 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8626 use arbitrary::{Arbitrary, Unstructured};
8627 let mut buf = [0u8; 1024];
8628 rng.fill_bytes(&mut buf);
8629 let mut unstructured = Unstructured::new(&buf);
8630 Self::arbitrary(&mut unstructured).unwrap_or_default()
8631 }
8632}
8633impl Default for COMMAND_CANCEL_DATA {
8634 fn default() -> Self {
8635 Self::DEFAULT.clone()
8636 }
8637}
8638impl MessageData for COMMAND_CANCEL_DATA {
8639 type Message = MavMessage;
8640 const ID: u32 = 80u32;
8641 const NAME: &'static str = "COMMAND_CANCEL";
8642 const EXTRA_CRC: u8 = 14u8;
8643 const ENCODED_LEN: usize = 4usize;
8644 fn deser(
8645 _version: MavlinkVersion,
8646 __input: &[u8],
8647 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8648 let avail_len = __input.len();
8649 let mut payload_buf = [0; Self::ENCODED_LEN];
8650 let mut buf = if avail_len < Self::ENCODED_LEN {
8651 payload_buf[0..avail_len].copy_from_slice(__input);
8652 Bytes::new(&payload_buf)
8653 } else {
8654 Bytes::new(__input)
8655 };
8656 let mut __struct = Self::default();
8657 let tmp = buf.get_u16_le();
8658 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8659 ::mavlink_core::error::ParserError::InvalidEnum {
8660 enum_type: "MavCmd",
8661 value: tmp as u32,
8662 },
8663 )?;
8664 __struct.target_system = buf.get_u8();
8665 __struct.target_component = buf.get_u8();
8666 Ok(__struct)
8667 }
8668 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8669 let mut __tmp = BytesMut::new(bytes);
8670 #[allow(clippy::absurd_extreme_comparisons)]
8671 #[allow(unused_comparisons)]
8672 if __tmp.remaining() < Self::ENCODED_LEN {
8673 panic!(
8674 "buffer is too small (need {} bytes, but got {})",
8675 Self::ENCODED_LEN,
8676 __tmp.remaining(),
8677 )
8678 }
8679 __tmp.put_u16_le(self.command as u16);
8680 __tmp.put_u8(self.target_system);
8681 __tmp.put_u8(self.target_component);
8682 if matches!(version, MavlinkVersion::V2) {
8683 let len = __tmp.len();
8684 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8685 } else {
8686 __tmp.len()
8687 }
8688 }
8689}
8690#[doc = "id: 75"]
8691#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8692#[derive(Debug, Clone, PartialEq)]
8693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8695pub struct COMMAND_INT_DATA {
8696 #[doc = "PARAM1, see MAV_CMD enum"]
8697 pub param1: f32,
8698 #[doc = "PARAM2, see MAV_CMD enum"]
8699 pub param2: f32,
8700 #[doc = "PARAM3, see MAV_CMD enum"]
8701 pub param3: f32,
8702 #[doc = "PARAM4, see MAV_CMD enum"]
8703 pub param4: f32,
8704 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
8705 pub x: i32,
8706 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
8707 pub y: i32,
8708 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
8709 pub z: f32,
8710 #[doc = "The scheduled action for the mission item."]
8711 pub command: MavCmd,
8712 #[doc = "System ID"]
8713 pub target_system: u8,
8714 #[doc = "Component ID"]
8715 pub target_component: u8,
8716 #[doc = "The coordinate system of the COMMAND."]
8717 pub frame: MavFrame,
8718 #[doc = "Not used."]
8719 pub current: u8,
8720 #[doc = "Not used (set 0)."]
8721 pub autocontinue: u8,
8722}
8723impl COMMAND_INT_DATA {
8724 pub const ENCODED_LEN: usize = 35usize;
8725 pub const DEFAULT: Self = Self {
8726 param1: 0.0_f32,
8727 param2: 0.0_f32,
8728 param3: 0.0_f32,
8729 param4: 0.0_f32,
8730 x: 0_i32,
8731 y: 0_i32,
8732 z: 0.0_f32,
8733 command: MavCmd::DEFAULT,
8734 target_system: 0_u8,
8735 target_component: 0_u8,
8736 frame: MavFrame::DEFAULT,
8737 current: 0_u8,
8738 autocontinue: 0_u8,
8739 };
8740 #[cfg(feature = "arbitrary")]
8741 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8742 use arbitrary::{Arbitrary, Unstructured};
8743 let mut buf = [0u8; 1024];
8744 rng.fill_bytes(&mut buf);
8745 let mut unstructured = Unstructured::new(&buf);
8746 Self::arbitrary(&mut unstructured).unwrap_or_default()
8747 }
8748}
8749impl Default for COMMAND_INT_DATA {
8750 fn default() -> Self {
8751 Self::DEFAULT.clone()
8752 }
8753}
8754impl MessageData for COMMAND_INT_DATA {
8755 type Message = MavMessage;
8756 const ID: u32 = 75u32;
8757 const NAME: &'static str = "COMMAND_INT";
8758 const EXTRA_CRC: u8 = 158u8;
8759 const ENCODED_LEN: usize = 35usize;
8760 fn deser(
8761 _version: MavlinkVersion,
8762 __input: &[u8],
8763 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8764 let avail_len = __input.len();
8765 let mut payload_buf = [0; Self::ENCODED_LEN];
8766 let mut buf = if avail_len < Self::ENCODED_LEN {
8767 payload_buf[0..avail_len].copy_from_slice(__input);
8768 Bytes::new(&payload_buf)
8769 } else {
8770 Bytes::new(__input)
8771 };
8772 let mut __struct = Self::default();
8773 __struct.param1 = buf.get_f32_le();
8774 __struct.param2 = buf.get_f32_le();
8775 __struct.param3 = buf.get_f32_le();
8776 __struct.param4 = buf.get_f32_le();
8777 __struct.x = buf.get_i32_le();
8778 __struct.y = buf.get_i32_le();
8779 __struct.z = buf.get_f32_le();
8780 let tmp = buf.get_u16_le();
8781 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8782 ::mavlink_core::error::ParserError::InvalidEnum {
8783 enum_type: "MavCmd",
8784 value: tmp as u32,
8785 },
8786 )?;
8787 __struct.target_system = buf.get_u8();
8788 __struct.target_component = buf.get_u8();
8789 let tmp = buf.get_u8();
8790 __struct.frame =
8791 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8792 enum_type: "MavFrame",
8793 value: tmp as u32,
8794 })?;
8795 __struct.current = buf.get_u8();
8796 __struct.autocontinue = buf.get_u8();
8797 Ok(__struct)
8798 }
8799 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8800 let mut __tmp = BytesMut::new(bytes);
8801 #[allow(clippy::absurd_extreme_comparisons)]
8802 #[allow(unused_comparisons)]
8803 if __tmp.remaining() < Self::ENCODED_LEN {
8804 panic!(
8805 "buffer is too small (need {} bytes, but got {})",
8806 Self::ENCODED_LEN,
8807 __tmp.remaining(),
8808 )
8809 }
8810 __tmp.put_f32_le(self.param1);
8811 __tmp.put_f32_le(self.param2);
8812 __tmp.put_f32_le(self.param3);
8813 __tmp.put_f32_le(self.param4);
8814 __tmp.put_i32_le(self.x);
8815 __tmp.put_i32_le(self.y);
8816 __tmp.put_f32_le(self.z);
8817 __tmp.put_u16_le(self.command as u16);
8818 __tmp.put_u8(self.target_system);
8819 __tmp.put_u8(self.target_component);
8820 __tmp.put_u8(self.frame as u8);
8821 __tmp.put_u8(self.current);
8822 __tmp.put_u8(self.autocontinue);
8823 if matches!(version, MavlinkVersion::V2) {
8824 let len = __tmp.len();
8825 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8826 } else {
8827 __tmp.len()
8828 }
8829 }
8830}
8831#[doc = "id: 76"]
8832#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8833#[derive(Debug, Clone, PartialEq)]
8834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8836pub struct COMMAND_LONG_DATA {
8837 #[doc = "Parameter 1 (for the specific command)."]
8838 pub param1: f32,
8839 #[doc = "Parameter 2 (for the specific command)."]
8840 pub param2: f32,
8841 #[doc = "Parameter 3 (for the specific command)."]
8842 pub param3: f32,
8843 #[doc = "Parameter 4 (for the specific command)."]
8844 pub param4: f32,
8845 #[doc = "Parameter 5 (for the specific command)."]
8846 pub param5: f32,
8847 #[doc = "Parameter 6 (for the specific command)."]
8848 pub param6: f32,
8849 #[doc = "Parameter 7 (for the specific command)."]
8850 pub param7: f32,
8851 #[doc = "Command ID (of command to send)."]
8852 pub command: MavCmd,
8853 #[doc = "System which should execute the command"]
8854 pub target_system: u8,
8855 #[doc = "Component which should execute the command, 0 for all components"]
8856 pub target_component: u8,
8857 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
8858 pub confirmation: u8,
8859}
8860impl COMMAND_LONG_DATA {
8861 pub const ENCODED_LEN: usize = 33usize;
8862 pub const DEFAULT: Self = Self {
8863 param1: 0.0_f32,
8864 param2: 0.0_f32,
8865 param3: 0.0_f32,
8866 param4: 0.0_f32,
8867 param5: 0.0_f32,
8868 param6: 0.0_f32,
8869 param7: 0.0_f32,
8870 command: MavCmd::DEFAULT,
8871 target_system: 0_u8,
8872 target_component: 0_u8,
8873 confirmation: 0_u8,
8874 };
8875 #[cfg(feature = "arbitrary")]
8876 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8877 use arbitrary::{Arbitrary, Unstructured};
8878 let mut buf = [0u8; 1024];
8879 rng.fill_bytes(&mut buf);
8880 let mut unstructured = Unstructured::new(&buf);
8881 Self::arbitrary(&mut unstructured).unwrap_or_default()
8882 }
8883}
8884impl Default for COMMAND_LONG_DATA {
8885 fn default() -> Self {
8886 Self::DEFAULT.clone()
8887 }
8888}
8889impl MessageData for COMMAND_LONG_DATA {
8890 type Message = MavMessage;
8891 const ID: u32 = 76u32;
8892 const NAME: &'static str = "COMMAND_LONG";
8893 const EXTRA_CRC: u8 = 152u8;
8894 const ENCODED_LEN: usize = 33usize;
8895 fn deser(
8896 _version: MavlinkVersion,
8897 __input: &[u8],
8898 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8899 let avail_len = __input.len();
8900 let mut payload_buf = [0; Self::ENCODED_LEN];
8901 let mut buf = if avail_len < Self::ENCODED_LEN {
8902 payload_buf[0..avail_len].copy_from_slice(__input);
8903 Bytes::new(&payload_buf)
8904 } else {
8905 Bytes::new(__input)
8906 };
8907 let mut __struct = Self::default();
8908 __struct.param1 = buf.get_f32_le();
8909 __struct.param2 = buf.get_f32_le();
8910 __struct.param3 = buf.get_f32_le();
8911 __struct.param4 = buf.get_f32_le();
8912 __struct.param5 = buf.get_f32_le();
8913 __struct.param6 = buf.get_f32_le();
8914 __struct.param7 = buf.get_f32_le();
8915 let tmp = buf.get_u16_le();
8916 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8917 ::mavlink_core::error::ParserError::InvalidEnum {
8918 enum_type: "MavCmd",
8919 value: tmp as u32,
8920 },
8921 )?;
8922 __struct.target_system = buf.get_u8();
8923 __struct.target_component = buf.get_u8();
8924 __struct.confirmation = buf.get_u8();
8925 Ok(__struct)
8926 }
8927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8928 let mut __tmp = BytesMut::new(bytes);
8929 #[allow(clippy::absurd_extreme_comparisons)]
8930 #[allow(unused_comparisons)]
8931 if __tmp.remaining() < Self::ENCODED_LEN {
8932 panic!(
8933 "buffer is too small (need {} bytes, but got {})",
8934 Self::ENCODED_LEN,
8935 __tmp.remaining(),
8936 )
8937 }
8938 __tmp.put_f32_le(self.param1);
8939 __tmp.put_f32_le(self.param2);
8940 __tmp.put_f32_le(self.param3);
8941 __tmp.put_f32_le(self.param4);
8942 __tmp.put_f32_le(self.param5);
8943 __tmp.put_f32_le(self.param6);
8944 __tmp.put_f32_le(self.param7);
8945 __tmp.put_u16_le(self.command as u16);
8946 __tmp.put_u8(self.target_system);
8947 __tmp.put_u8(self.target_component);
8948 __tmp.put_u8(self.confirmation);
8949 if matches!(version, MavlinkVersion::V2) {
8950 let len = __tmp.len();
8951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8952 } else {
8953 __tmp.len()
8954 }
8955 }
8956}
8957#[doc = "id: 395"]
8958#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
8959#[derive(Debug, Clone, PartialEq)]
8960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8962pub struct COMPONENT_INFORMATION_DATA {
8963 #[doc = "Timestamp (time since system boot)."]
8964 pub time_boot_ms: u32,
8965 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
8966 pub general_metadata_file_crc: u32,
8967 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
8968 pub peripherals_metadata_file_crc: u32,
8969 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
8970 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8971 pub general_metadata_uri: [u8; 100],
8972 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
8973 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8974 pub peripherals_metadata_uri: [u8; 100],
8975}
8976impl COMPONENT_INFORMATION_DATA {
8977 pub const ENCODED_LEN: usize = 212usize;
8978 pub const DEFAULT: Self = Self {
8979 time_boot_ms: 0_u32,
8980 general_metadata_file_crc: 0_u32,
8981 peripherals_metadata_file_crc: 0_u32,
8982 general_metadata_uri: [0_u8; 100usize],
8983 peripherals_metadata_uri: [0_u8; 100usize],
8984 };
8985 #[cfg(feature = "arbitrary")]
8986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8987 use arbitrary::{Arbitrary, Unstructured};
8988 let mut buf = [0u8; 1024];
8989 rng.fill_bytes(&mut buf);
8990 let mut unstructured = Unstructured::new(&buf);
8991 Self::arbitrary(&mut unstructured).unwrap_or_default()
8992 }
8993}
8994impl Default for COMPONENT_INFORMATION_DATA {
8995 fn default() -> Self {
8996 Self::DEFAULT.clone()
8997 }
8998}
8999impl MessageData for COMPONENT_INFORMATION_DATA {
9000 type Message = MavMessage;
9001 const ID: u32 = 395u32;
9002 const NAME: &'static str = "COMPONENT_INFORMATION";
9003 const EXTRA_CRC: u8 = 0u8;
9004 const ENCODED_LEN: usize = 212usize;
9005 fn deser(
9006 _version: MavlinkVersion,
9007 __input: &[u8],
9008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9009 let avail_len = __input.len();
9010 let mut payload_buf = [0; Self::ENCODED_LEN];
9011 let mut buf = if avail_len < Self::ENCODED_LEN {
9012 payload_buf[0..avail_len].copy_from_slice(__input);
9013 Bytes::new(&payload_buf)
9014 } else {
9015 Bytes::new(__input)
9016 };
9017 let mut __struct = Self::default();
9018 __struct.time_boot_ms = buf.get_u32_le();
9019 __struct.general_metadata_file_crc = buf.get_u32_le();
9020 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9021 for v in &mut __struct.general_metadata_uri {
9022 let val = buf.get_u8();
9023 *v = val;
9024 }
9025 for v in &mut __struct.peripherals_metadata_uri {
9026 let val = buf.get_u8();
9027 *v = val;
9028 }
9029 Ok(__struct)
9030 }
9031 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9032 let mut __tmp = BytesMut::new(bytes);
9033 #[allow(clippy::absurd_extreme_comparisons)]
9034 #[allow(unused_comparisons)]
9035 if __tmp.remaining() < Self::ENCODED_LEN {
9036 panic!(
9037 "buffer is too small (need {} bytes, but got {})",
9038 Self::ENCODED_LEN,
9039 __tmp.remaining(),
9040 )
9041 }
9042 __tmp.put_u32_le(self.time_boot_ms);
9043 __tmp.put_u32_le(self.general_metadata_file_crc);
9044 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9045 for val in &self.general_metadata_uri {
9046 __tmp.put_u8(*val);
9047 }
9048 for val in &self.peripherals_metadata_uri {
9049 __tmp.put_u8(*val);
9050 }
9051 if matches!(version, MavlinkVersion::V2) {
9052 let len = __tmp.len();
9053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9054 } else {
9055 __tmp.len()
9056 }
9057 }
9058}
9059#[doc = "id: 396"]
9060#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9061#[derive(Debug, Clone, PartialEq)]
9062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9064pub struct COMPONENT_INFORMATION_BASIC_DATA {
9065 #[doc = "Component capability flags"]
9066 pub capabilities: MavProtocolCapability,
9067 #[doc = "Timestamp (time since system boot)."]
9068 pub time_boot_ms: u32,
9069 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9070 pub time_manufacture_s: u32,
9071 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9072 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9073 pub vendor_name: [u8; 32],
9074 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9075 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9076 pub model_name: [u8; 32],
9077 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9078 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9079 pub software_version: [u8; 24],
9080 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9081 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9082 pub hardware_version: [u8; 24],
9083 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9084 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9085 pub serial_number: [u8; 32],
9086}
9087impl COMPONENT_INFORMATION_BASIC_DATA {
9088 pub const ENCODED_LEN: usize = 160usize;
9089 pub const DEFAULT: Self = Self {
9090 capabilities: MavProtocolCapability::DEFAULT,
9091 time_boot_ms: 0_u32,
9092 time_manufacture_s: 0_u32,
9093 vendor_name: [0_u8; 32usize],
9094 model_name: [0_u8; 32usize],
9095 software_version: [0_u8; 24usize],
9096 hardware_version: [0_u8; 24usize],
9097 serial_number: [0_u8; 32usize],
9098 };
9099 #[cfg(feature = "arbitrary")]
9100 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9101 use arbitrary::{Arbitrary, Unstructured};
9102 let mut buf = [0u8; 1024];
9103 rng.fill_bytes(&mut buf);
9104 let mut unstructured = Unstructured::new(&buf);
9105 Self::arbitrary(&mut unstructured).unwrap_or_default()
9106 }
9107}
9108impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9109 fn default() -> Self {
9110 Self::DEFAULT.clone()
9111 }
9112}
9113impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9114 type Message = MavMessage;
9115 const ID: u32 = 396u32;
9116 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9117 const EXTRA_CRC: u8 = 50u8;
9118 const ENCODED_LEN: usize = 160usize;
9119 fn deser(
9120 _version: MavlinkVersion,
9121 __input: &[u8],
9122 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9123 let avail_len = __input.len();
9124 let mut payload_buf = [0; Self::ENCODED_LEN];
9125 let mut buf = if avail_len < Self::ENCODED_LEN {
9126 payload_buf[0..avail_len].copy_from_slice(__input);
9127 Bytes::new(&payload_buf)
9128 } else {
9129 Bytes::new(__input)
9130 };
9131 let mut __struct = Self::default();
9132 let tmp = buf.get_u64_le();
9133 __struct.capabilities = MavProtocolCapability::from_bits(
9134 tmp & MavProtocolCapability::all().bits(),
9135 )
9136 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9137 flag_type: "MavProtocolCapability",
9138 value: tmp as u32,
9139 })?;
9140 __struct.time_boot_ms = buf.get_u32_le();
9141 __struct.time_manufacture_s = buf.get_u32_le();
9142 for v in &mut __struct.vendor_name {
9143 let val = buf.get_u8();
9144 *v = val;
9145 }
9146 for v in &mut __struct.model_name {
9147 let val = buf.get_u8();
9148 *v = val;
9149 }
9150 for v in &mut __struct.software_version {
9151 let val = buf.get_u8();
9152 *v = val;
9153 }
9154 for v in &mut __struct.hardware_version {
9155 let val = buf.get_u8();
9156 *v = val;
9157 }
9158 for v in &mut __struct.serial_number {
9159 let val = buf.get_u8();
9160 *v = val;
9161 }
9162 Ok(__struct)
9163 }
9164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9165 let mut __tmp = BytesMut::new(bytes);
9166 #[allow(clippy::absurd_extreme_comparisons)]
9167 #[allow(unused_comparisons)]
9168 if __tmp.remaining() < Self::ENCODED_LEN {
9169 panic!(
9170 "buffer is too small (need {} bytes, but got {})",
9171 Self::ENCODED_LEN,
9172 __tmp.remaining(),
9173 )
9174 }
9175 __tmp.put_u64_le(self.capabilities.bits());
9176 __tmp.put_u32_le(self.time_boot_ms);
9177 __tmp.put_u32_le(self.time_manufacture_s);
9178 for val in &self.vendor_name {
9179 __tmp.put_u8(*val);
9180 }
9181 for val in &self.model_name {
9182 __tmp.put_u8(*val);
9183 }
9184 for val in &self.software_version {
9185 __tmp.put_u8(*val);
9186 }
9187 for val in &self.hardware_version {
9188 __tmp.put_u8(*val);
9189 }
9190 for val in &self.serial_number {
9191 __tmp.put_u8(*val);
9192 }
9193 if matches!(version, MavlinkVersion::V2) {
9194 let len = __tmp.len();
9195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9196 } else {
9197 __tmp.len()
9198 }
9199 }
9200}
9201#[doc = "id: 397"]
9202#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9203#[derive(Debug, Clone, PartialEq)]
9204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9206pub struct COMPONENT_METADATA_DATA {
9207 #[doc = "Timestamp (time since system boot)."]
9208 pub time_boot_ms: u32,
9209 #[doc = "CRC32 of the general metadata file."]
9210 pub file_crc: u32,
9211 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9212 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9213 pub uri: [u8; 100],
9214}
9215impl COMPONENT_METADATA_DATA {
9216 pub const ENCODED_LEN: usize = 108usize;
9217 pub const DEFAULT: Self = Self {
9218 time_boot_ms: 0_u32,
9219 file_crc: 0_u32,
9220 uri: [0_u8; 100usize],
9221 };
9222 #[cfg(feature = "arbitrary")]
9223 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9224 use arbitrary::{Arbitrary, Unstructured};
9225 let mut buf = [0u8; 1024];
9226 rng.fill_bytes(&mut buf);
9227 let mut unstructured = Unstructured::new(&buf);
9228 Self::arbitrary(&mut unstructured).unwrap_or_default()
9229 }
9230}
9231impl Default for COMPONENT_METADATA_DATA {
9232 fn default() -> Self {
9233 Self::DEFAULT.clone()
9234 }
9235}
9236impl MessageData for COMPONENT_METADATA_DATA {
9237 type Message = MavMessage;
9238 const ID: u32 = 397u32;
9239 const NAME: &'static str = "COMPONENT_METADATA";
9240 const EXTRA_CRC: u8 = 182u8;
9241 const ENCODED_LEN: usize = 108usize;
9242 fn deser(
9243 _version: MavlinkVersion,
9244 __input: &[u8],
9245 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9246 let avail_len = __input.len();
9247 let mut payload_buf = [0; Self::ENCODED_LEN];
9248 let mut buf = if avail_len < Self::ENCODED_LEN {
9249 payload_buf[0..avail_len].copy_from_slice(__input);
9250 Bytes::new(&payload_buf)
9251 } else {
9252 Bytes::new(__input)
9253 };
9254 let mut __struct = Self::default();
9255 __struct.time_boot_ms = buf.get_u32_le();
9256 __struct.file_crc = buf.get_u32_le();
9257 for v in &mut __struct.uri {
9258 let val = buf.get_u8();
9259 *v = val;
9260 }
9261 Ok(__struct)
9262 }
9263 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9264 let mut __tmp = BytesMut::new(bytes);
9265 #[allow(clippy::absurd_extreme_comparisons)]
9266 #[allow(unused_comparisons)]
9267 if __tmp.remaining() < Self::ENCODED_LEN {
9268 panic!(
9269 "buffer is too small (need {} bytes, but got {})",
9270 Self::ENCODED_LEN,
9271 __tmp.remaining(),
9272 )
9273 }
9274 __tmp.put_u32_le(self.time_boot_ms);
9275 __tmp.put_u32_le(self.file_crc);
9276 for val in &self.uri {
9277 __tmp.put_u8(*val);
9278 }
9279 if matches!(version, MavlinkVersion::V2) {
9280 let len = __tmp.len();
9281 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9282 } else {
9283 __tmp.len()
9284 }
9285 }
9286}
9287#[doc = "id: 146"]
9288#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9289#[derive(Debug, Clone, PartialEq)]
9290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9292pub struct CONTROL_SYSTEM_STATE_DATA {
9293 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9294 pub time_usec: u64,
9295 #[doc = "X acceleration in body frame"]
9296 pub x_acc: f32,
9297 #[doc = "Y acceleration in body frame"]
9298 pub y_acc: f32,
9299 #[doc = "Z acceleration in body frame"]
9300 pub z_acc: f32,
9301 #[doc = "X velocity in body frame"]
9302 pub x_vel: f32,
9303 #[doc = "Y velocity in body frame"]
9304 pub y_vel: f32,
9305 #[doc = "Z velocity in body frame"]
9306 pub z_vel: f32,
9307 #[doc = "X position in local frame"]
9308 pub x_pos: f32,
9309 #[doc = "Y position in local frame"]
9310 pub y_pos: f32,
9311 #[doc = "Z position in local frame"]
9312 pub z_pos: f32,
9313 #[doc = "Airspeed, set to -1 if unknown"]
9314 pub airspeed: f32,
9315 #[doc = "Variance of body velocity estimate"]
9316 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9317 pub vel_variance: [f32; 3],
9318 #[doc = "Variance in local position"]
9319 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9320 pub pos_variance: [f32; 3],
9321 #[doc = "The attitude, represented as Quaternion"]
9322 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9323 pub q: [f32; 4],
9324 #[doc = "Angular rate in roll axis"]
9325 pub roll_rate: f32,
9326 #[doc = "Angular rate in pitch axis"]
9327 pub pitch_rate: f32,
9328 #[doc = "Angular rate in yaw axis"]
9329 pub yaw_rate: f32,
9330}
9331impl CONTROL_SYSTEM_STATE_DATA {
9332 pub const ENCODED_LEN: usize = 100usize;
9333 pub const DEFAULT: Self = Self {
9334 time_usec: 0_u64,
9335 x_acc: 0.0_f32,
9336 y_acc: 0.0_f32,
9337 z_acc: 0.0_f32,
9338 x_vel: 0.0_f32,
9339 y_vel: 0.0_f32,
9340 z_vel: 0.0_f32,
9341 x_pos: 0.0_f32,
9342 y_pos: 0.0_f32,
9343 z_pos: 0.0_f32,
9344 airspeed: 0.0_f32,
9345 vel_variance: [0.0_f32; 3usize],
9346 pos_variance: [0.0_f32; 3usize],
9347 q: [0.0_f32; 4usize],
9348 roll_rate: 0.0_f32,
9349 pitch_rate: 0.0_f32,
9350 yaw_rate: 0.0_f32,
9351 };
9352 #[cfg(feature = "arbitrary")]
9353 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9354 use arbitrary::{Arbitrary, Unstructured};
9355 let mut buf = [0u8; 1024];
9356 rng.fill_bytes(&mut buf);
9357 let mut unstructured = Unstructured::new(&buf);
9358 Self::arbitrary(&mut unstructured).unwrap_or_default()
9359 }
9360}
9361impl Default for CONTROL_SYSTEM_STATE_DATA {
9362 fn default() -> Self {
9363 Self::DEFAULT.clone()
9364 }
9365}
9366impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9367 type Message = MavMessage;
9368 const ID: u32 = 146u32;
9369 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9370 const EXTRA_CRC: u8 = 103u8;
9371 const ENCODED_LEN: usize = 100usize;
9372 fn deser(
9373 _version: MavlinkVersion,
9374 __input: &[u8],
9375 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9376 let avail_len = __input.len();
9377 let mut payload_buf = [0; Self::ENCODED_LEN];
9378 let mut buf = if avail_len < Self::ENCODED_LEN {
9379 payload_buf[0..avail_len].copy_from_slice(__input);
9380 Bytes::new(&payload_buf)
9381 } else {
9382 Bytes::new(__input)
9383 };
9384 let mut __struct = Self::default();
9385 __struct.time_usec = buf.get_u64_le();
9386 __struct.x_acc = buf.get_f32_le();
9387 __struct.y_acc = buf.get_f32_le();
9388 __struct.z_acc = buf.get_f32_le();
9389 __struct.x_vel = buf.get_f32_le();
9390 __struct.y_vel = buf.get_f32_le();
9391 __struct.z_vel = buf.get_f32_le();
9392 __struct.x_pos = buf.get_f32_le();
9393 __struct.y_pos = buf.get_f32_le();
9394 __struct.z_pos = buf.get_f32_le();
9395 __struct.airspeed = buf.get_f32_le();
9396 for v in &mut __struct.vel_variance {
9397 let val = buf.get_f32_le();
9398 *v = val;
9399 }
9400 for v in &mut __struct.pos_variance {
9401 let val = buf.get_f32_le();
9402 *v = val;
9403 }
9404 for v in &mut __struct.q {
9405 let val = buf.get_f32_le();
9406 *v = val;
9407 }
9408 __struct.roll_rate = buf.get_f32_le();
9409 __struct.pitch_rate = buf.get_f32_le();
9410 __struct.yaw_rate = buf.get_f32_le();
9411 Ok(__struct)
9412 }
9413 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9414 let mut __tmp = BytesMut::new(bytes);
9415 #[allow(clippy::absurd_extreme_comparisons)]
9416 #[allow(unused_comparisons)]
9417 if __tmp.remaining() < Self::ENCODED_LEN {
9418 panic!(
9419 "buffer is too small (need {} bytes, but got {})",
9420 Self::ENCODED_LEN,
9421 __tmp.remaining(),
9422 )
9423 }
9424 __tmp.put_u64_le(self.time_usec);
9425 __tmp.put_f32_le(self.x_acc);
9426 __tmp.put_f32_le(self.y_acc);
9427 __tmp.put_f32_le(self.z_acc);
9428 __tmp.put_f32_le(self.x_vel);
9429 __tmp.put_f32_le(self.y_vel);
9430 __tmp.put_f32_le(self.z_vel);
9431 __tmp.put_f32_le(self.x_pos);
9432 __tmp.put_f32_le(self.y_pos);
9433 __tmp.put_f32_le(self.z_pos);
9434 __tmp.put_f32_le(self.airspeed);
9435 for val in &self.vel_variance {
9436 __tmp.put_f32_le(*val);
9437 }
9438 for val in &self.pos_variance {
9439 __tmp.put_f32_le(*val);
9440 }
9441 for val in &self.q {
9442 __tmp.put_f32_le(*val);
9443 }
9444 __tmp.put_f32_le(self.roll_rate);
9445 __tmp.put_f32_le(self.pitch_rate);
9446 __tmp.put_f32_le(self.yaw_rate);
9447 if matches!(version, MavlinkVersion::V2) {
9448 let len = __tmp.len();
9449 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9450 } else {
9451 __tmp.len()
9452 }
9453 }
9454}
9455#[doc = "id: 50005"]
9456#[doc = "offset response to encapsulated data."]
9457#[derive(Debug, Clone, PartialEq)]
9458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9460pub struct CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9461 #[doc = "FW Offset."]
9462 pub offset: u32,
9463 #[doc = "System ID."]
9464 pub target_system: u8,
9465 #[doc = "Component ID."]
9466 pub target_component: u8,
9467}
9468impl CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9469 pub const ENCODED_LEN: usize = 6usize;
9470 pub const DEFAULT: Self = Self {
9471 offset: 0_u32,
9472 target_system: 0_u8,
9473 target_component: 0_u8,
9474 };
9475 #[cfg(feature = "arbitrary")]
9476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9477 use arbitrary::{Arbitrary, Unstructured};
9478 let mut buf = [0u8; 1024];
9479 rng.fill_bytes(&mut buf);
9480 let mut unstructured = Unstructured::new(&buf);
9481 Self::arbitrary(&mut unstructured).unwrap_or_default()
9482 }
9483}
9484impl Default for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9485 fn default() -> Self {
9486 Self::DEFAULT.clone()
9487 }
9488}
9489impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9490 type Message = MavMessage;
9491 const ID: u32 = 50005u32;
9492 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_RESP";
9493 const EXTRA_CRC: u8 = 152u8;
9494 const ENCODED_LEN: usize = 6usize;
9495 fn deser(
9496 _version: MavlinkVersion,
9497 __input: &[u8],
9498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9499 let avail_len = __input.len();
9500 let mut payload_buf = [0; Self::ENCODED_LEN];
9501 let mut buf = if avail_len < Self::ENCODED_LEN {
9502 payload_buf[0..avail_len].copy_from_slice(__input);
9503 Bytes::new(&payload_buf)
9504 } else {
9505 Bytes::new(__input)
9506 };
9507 let mut __struct = Self::default();
9508 __struct.offset = buf.get_u32_le();
9509 __struct.target_system = buf.get_u8();
9510 __struct.target_component = buf.get_u8();
9511 Ok(__struct)
9512 }
9513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9514 let mut __tmp = BytesMut::new(bytes);
9515 #[allow(clippy::absurd_extreme_comparisons)]
9516 #[allow(unused_comparisons)]
9517 if __tmp.remaining() < Self::ENCODED_LEN {
9518 panic!(
9519 "buffer is too small (need {} bytes, but got {})",
9520 Self::ENCODED_LEN,
9521 __tmp.remaining(),
9522 )
9523 }
9524 __tmp.put_u32_le(self.offset);
9525 __tmp.put_u8(self.target_system);
9526 __tmp.put_u8(self.target_component);
9527 if matches!(version, MavlinkVersion::V2) {
9528 let len = __tmp.len();
9529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9530 } else {
9531 __tmp.len()
9532 }
9533 }
9534}
9535#[doc = "id: 50004"]
9536#[doc = "Start firmware update with encapsulated data."]
9537#[derive(Debug, Clone, PartialEq)]
9538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9540pub struct CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9541 #[doc = "FW Size."]
9542 pub size: u32,
9543 #[doc = "FW CRC."]
9544 pub crc: u32,
9545 #[doc = "System ID."]
9546 pub target_system: u8,
9547 #[doc = "Component ID."]
9548 pub target_component: u8,
9549}
9550impl CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9551 pub const ENCODED_LEN: usize = 10usize;
9552 pub const DEFAULT: Self = Self {
9553 size: 0_u32,
9554 crc: 0_u32,
9555 target_system: 0_u8,
9556 target_component: 0_u8,
9557 };
9558 #[cfg(feature = "arbitrary")]
9559 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9560 use arbitrary::{Arbitrary, Unstructured};
9561 let mut buf = [0u8; 1024];
9562 rng.fill_bytes(&mut buf);
9563 let mut unstructured = Unstructured::new(&buf);
9564 Self::arbitrary(&mut unstructured).unwrap_or_default()
9565 }
9566}
9567impl Default for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9568 fn default() -> Self {
9569 Self::DEFAULT.clone()
9570 }
9571}
9572impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9573 type Message = MavMessage;
9574 const ID: u32 = 50004u32;
9575 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_START";
9576 const EXTRA_CRC: u8 = 240u8;
9577 const ENCODED_LEN: usize = 10usize;
9578 fn deser(
9579 _version: MavlinkVersion,
9580 __input: &[u8],
9581 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9582 let avail_len = __input.len();
9583 let mut payload_buf = [0; Self::ENCODED_LEN];
9584 let mut buf = if avail_len < Self::ENCODED_LEN {
9585 payload_buf[0..avail_len].copy_from_slice(__input);
9586 Bytes::new(&payload_buf)
9587 } else {
9588 Bytes::new(__input)
9589 };
9590 let mut __struct = Self::default();
9591 __struct.size = buf.get_u32_le();
9592 __struct.crc = buf.get_u32_le();
9593 __struct.target_system = buf.get_u8();
9594 __struct.target_component = buf.get_u8();
9595 Ok(__struct)
9596 }
9597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9598 let mut __tmp = BytesMut::new(bytes);
9599 #[allow(clippy::absurd_extreme_comparisons)]
9600 #[allow(unused_comparisons)]
9601 if __tmp.remaining() < Self::ENCODED_LEN {
9602 panic!(
9603 "buffer is too small (need {} bytes, but got {})",
9604 Self::ENCODED_LEN,
9605 __tmp.remaining(),
9606 )
9607 }
9608 __tmp.put_u32_le(self.size);
9609 __tmp.put_u32_le(self.crc);
9610 __tmp.put_u8(self.target_system);
9611 __tmp.put_u8(self.target_component);
9612 if matches!(version, MavlinkVersion::V2) {
9613 let len = __tmp.len();
9614 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9615 } else {
9616 __tmp.len()
9617 }
9618 }
9619}
9620#[doc = "id: 50001"]
9621#[doc = "Raw RC Data."]
9622#[derive(Debug, Clone, PartialEq)]
9623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9625pub struct CUBEPILOT_RAW_RC_DATA {}
9626impl CUBEPILOT_RAW_RC_DATA {
9627 pub const ENCODED_LEN: usize = 0usize;
9628 pub const DEFAULT: Self = Self {};
9629 #[cfg(feature = "arbitrary")]
9630 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9631 use arbitrary::{Arbitrary, Unstructured};
9632 let mut buf = [0u8; 1024];
9633 rng.fill_bytes(&mut buf);
9634 let mut unstructured = Unstructured::new(&buf);
9635 Self::arbitrary(&mut unstructured).unwrap_or_default()
9636 }
9637}
9638impl Default for CUBEPILOT_RAW_RC_DATA {
9639 fn default() -> Self {
9640 Self::DEFAULT.clone()
9641 }
9642}
9643impl MessageData for CUBEPILOT_RAW_RC_DATA {
9644 type Message = MavMessage;
9645 const ID: u32 = 50001u32;
9646 const NAME: &'static str = "CUBEPILOT_RAW_RC";
9647 const EXTRA_CRC: u8 = 1u8;
9648 const ENCODED_LEN: usize = 0usize;
9649 fn deser(
9650 _version: MavlinkVersion,
9651 __input: &[u8],
9652 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9653 Ok(Self::default())
9654 }
9655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9656 let mut __tmp = BytesMut::new(bytes);
9657 #[allow(clippy::absurd_extreme_comparisons)]
9658 #[allow(unused_comparisons)]
9659 if __tmp.remaining() < Self::ENCODED_LEN {
9660 panic!(
9661 "buffer is too small (need {} bytes, but got {})",
9662 Self::ENCODED_LEN,
9663 __tmp.remaining(),
9664 )
9665 }
9666 if matches!(version, MavlinkVersion::V2) {
9667 let len = __tmp.len();
9668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9669 } else {
9670 __tmp.len()
9671 }
9672 }
9673}
9674#[doc = "id: 411"]
9675#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9676#[derive(Debug, Clone, PartialEq)]
9677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9679pub struct CURRENT_EVENT_SEQUENCE_DATA {
9680 #[doc = "Sequence number."]
9681 pub sequence: u16,
9682 #[doc = "Flag bitset."]
9683 pub flags: MavEventCurrentSequenceFlags,
9684}
9685impl CURRENT_EVENT_SEQUENCE_DATA {
9686 pub const ENCODED_LEN: usize = 3usize;
9687 pub const DEFAULT: Self = Self {
9688 sequence: 0_u16,
9689 flags: MavEventCurrentSequenceFlags::DEFAULT,
9690 };
9691 #[cfg(feature = "arbitrary")]
9692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9693 use arbitrary::{Arbitrary, Unstructured};
9694 let mut buf = [0u8; 1024];
9695 rng.fill_bytes(&mut buf);
9696 let mut unstructured = Unstructured::new(&buf);
9697 Self::arbitrary(&mut unstructured).unwrap_or_default()
9698 }
9699}
9700impl Default for CURRENT_EVENT_SEQUENCE_DATA {
9701 fn default() -> Self {
9702 Self::DEFAULT.clone()
9703 }
9704}
9705impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
9706 type Message = MavMessage;
9707 const ID: u32 = 411u32;
9708 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
9709 const EXTRA_CRC: u8 = 106u8;
9710 const ENCODED_LEN: usize = 3usize;
9711 fn deser(
9712 _version: MavlinkVersion,
9713 __input: &[u8],
9714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9715 let avail_len = __input.len();
9716 let mut payload_buf = [0; Self::ENCODED_LEN];
9717 let mut buf = if avail_len < Self::ENCODED_LEN {
9718 payload_buf[0..avail_len].copy_from_slice(__input);
9719 Bytes::new(&payload_buf)
9720 } else {
9721 Bytes::new(__input)
9722 };
9723 let mut __struct = Self::default();
9724 __struct.sequence = buf.get_u16_le();
9725 let tmp = buf.get_u8();
9726 __struct.flags =
9727 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9728 enum_type: "MavEventCurrentSequenceFlags",
9729 value: tmp as u32,
9730 })?;
9731 Ok(__struct)
9732 }
9733 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9734 let mut __tmp = BytesMut::new(bytes);
9735 #[allow(clippy::absurd_extreme_comparisons)]
9736 #[allow(unused_comparisons)]
9737 if __tmp.remaining() < Self::ENCODED_LEN {
9738 panic!(
9739 "buffer is too small (need {} bytes, but got {})",
9740 Self::ENCODED_LEN,
9741 __tmp.remaining(),
9742 )
9743 }
9744 __tmp.put_u16_le(self.sequence);
9745 __tmp.put_u8(self.flags as u8);
9746 if matches!(version, MavlinkVersion::V2) {
9747 let len = __tmp.len();
9748 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9749 } else {
9750 __tmp.len()
9751 }
9752 }
9753}
9754#[doc = "id: 436"]
9755#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
9756#[derive(Debug, Clone, PartialEq)]
9757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9759pub struct CURRENT_MODE_DATA {
9760 #[doc = "A bitfield for use for autopilot-specific flags"]
9761 pub custom_mode: u32,
9762 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
9763 pub intended_custom_mode: u32,
9764 #[doc = "Standard mode."]
9765 pub standard_mode: MavStandardMode,
9766}
9767impl CURRENT_MODE_DATA {
9768 pub const ENCODED_LEN: usize = 9usize;
9769 pub const DEFAULT: Self = Self {
9770 custom_mode: 0_u32,
9771 intended_custom_mode: 0_u32,
9772 standard_mode: MavStandardMode::DEFAULT,
9773 };
9774 #[cfg(feature = "arbitrary")]
9775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9776 use arbitrary::{Arbitrary, Unstructured};
9777 let mut buf = [0u8; 1024];
9778 rng.fill_bytes(&mut buf);
9779 let mut unstructured = Unstructured::new(&buf);
9780 Self::arbitrary(&mut unstructured).unwrap_or_default()
9781 }
9782}
9783impl Default for CURRENT_MODE_DATA {
9784 fn default() -> Self {
9785 Self::DEFAULT.clone()
9786 }
9787}
9788impl MessageData for CURRENT_MODE_DATA {
9789 type Message = MavMessage;
9790 const ID: u32 = 436u32;
9791 const NAME: &'static str = "CURRENT_MODE";
9792 const EXTRA_CRC: u8 = 193u8;
9793 const ENCODED_LEN: usize = 9usize;
9794 fn deser(
9795 _version: MavlinkVersion,
9796 __input: &[u8],
9797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9798 let avail_len = __input.len();
9799 let mut payload_buf = [0; Self::ENCODED_LEN];
9800 let mut buf = if avail_len < Self::ENCODED_LEN {
9801 payload_buf[0..avail_len].copy_from_slice(__input);
9802 Bytes::new(&payload_buf)
9803 } else {
9804 Bytes::new(__input)
9805 };
9806 let mut __struct = Self::default();
9807 __struct.custom_mode = buf.get_u32_le();
9808 __struct.intended_custom_mode = buf.get_u32_le();
9809 let tmp = buf.get_u8();
9810 __struct.standard_mode =
9811 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9812 enum_type: "MavStandardMode",
9813 value: tmp as u32,
9814 })?;
9815 Ok(__struct)
9816 }
9817 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9818 let mut __tmp = BytesMut::new(bytes);
9819 #[allow(clippy::absurd_extreme_comparisons)]
9820 #[allow(unused_comparisons)]
9821 if __tmp.remaining() < Self::ENCODED_LEN {
9822 panic!(
9823 "buffer is too small (need {} bytes, but got {})",
9824 Self::ENCODED_LEN,
9825 __tmp.remaining(),
9826 )
9827 }
9828 __tmp.put_u32_le(self.custom_mode);
9829 __tmp.put_u32_le(self.intended_custom_mode);
9830 __tmp.put_u8(self.standard_mode as u8);
9831 if matches!(version, MavlinkVersion::V2) {
9832 let len = __tmp.len();
9833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9834 } else {
9835 __tmp.len()
9836 }
9837 }
9838}
9839#[doc = "id: 67"]
9840#[doc = "Data stream status information."]
9841#[derive(Debug, Clone, PartialEq)]
9842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9844pub struct DATA_STREAM_DATA {
9845 #[doc = "The message rate"]
9846 pub message_rate: u16,
9847 #[doc = "The ID of the requested data stream"]
9848 pub stream_id: u8,
9849 #[doc = "1 stream is enabled, 0 stream is stopped."]
9850 pub on_off: u8,
9851}
9852impl DATA_STREAM_DATA {
9853 pub const ENCODED_LEN: usize = 4usize;
9854 pub const DEFAULT: Self = Self {
9855 message_rate: 0_u16,
9856 stream_id: 0_u8,
9857 on_off: 0_u8,
9858 };
9859 #[cfg(feature = "arbitrary")]
9860 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9861 use arbitrary::{Arbitrary, Unstructured};
9862 let mut buf = [0u8; 1024];
9863 rng.fill_bytes(&mut buf);
9864 let mut unstructured = Unstructured::new(&buf);
9865 Self::arbitrary(&mut unstructured).unwrap_or_default()
9866 }
9867}
9868impl Default for DATA_STREAM_DATA {
9869 fn default() -> Self {
9870 Self::DEFAULT.clone()
9871 }
9872}
9873impl MessageData for DATA_STREAM_DATA {
9874 type Message = MavMessage;
9875 const ID: u32 = 67u32;
9876 const NAME: &'static str = "DATA_STREAM";
9877 const EXTRA_CRC: u8 = 21u8;
9878 const ENCODED_LEN: usize = 4usize;
9879 fn deser(
9880 _version: MavlinkVersion,
9881 __input: &[u8],
9882 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9883 let avail_len = __input.len();
9884 let mut payload_buf = [0; Self::ENCODED_LEN];
9885 let mut buf = if avail_len < Self::ENCODED_LEN {
9886 payload_buf[0..avail_len].copy_from_slice(__input);
9887 Bytes::new(&payload_buf)
9888 } else {
9889 Bytes::new(__input)
9890 };
9891 let mut __struct = Self::default();
9892 __struct.message_rate = buf.get_u16_le();
9893 __struct.stream_id = buf.get_u8();
9894 __struct.on_off = buf.get_u8();
9895 Ok(__struct)
9896 }
9897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9898 let mut __tmp = BytesMut::new(bytes);
9899 #[allow(clippy::absurd_extreme_comparisons)]
9900 #[allow(unused_comparisons)]
9901 if __tmp.remaining() < Self::ENCODED_LEN {
9902 panic!(
9903 "buffer is too small (need {} bytes, but got {})",
9904 Self::ENCODED_LEN,
9905 __tmp.remaining(),
9906 )
9907 }
9908 __tmp.put_u16_le(self.message_rate);
9909 __tmp.put_u8(self.stream_id);
9910 __tmp.put_u8(self.on_off);
9911 if matches!(version, MavlinkVersion::V2) {
9912 let len = __tmp.len();
9913 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9914 } else {
9915 __tmp.len()
9916 }
9917 }
9918}
9919#[doc = "id: 130"]
9920#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
9921#[derive(Debug, Clone, PartialEq)]
9922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9924pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
9925 #[doc = "total data size (set on ACK only)."]
9926 pub size: u32,
9927 #[doc = "Width of a matrix or image."]
9928 pub width: u16,
9929 #[doc = "Height of a matrix or image."]
9930 pub height: u16,
9931 #[doc = "Number of packets being sent (set on ACK only)."]
9932 pub packets: u16,
9933 #[doc = "Type of requested/acknowledged data."]
9934 pub mavtype: MavlinkDataStreamType,
9935 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
9936 pub payload: u8,
9937 #[doc = "JPEG quality. Values: [1-100]."]
9938 pub jpg_quality: u8,
9939}
9940impl DATA_TRANSMISSION_HANDSHAKE_DATA {
9941 pub const ENCODED_LEN: usize = 13usize;
9942 pub const DEFAULT: Self = Self {
9943 size: 0_u32,
9944 width: 0_u16,
9945 height: 0_u16,
9946 packets: 0_u16,
9947 mavtype: MavlinkDataStreamType::DEFAULT,
9948 payload: 0_u8,
9949 jpg_quality: 0_u8,
9950 };
9951 #[cfg(feature = "arbitrary")]
9952 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9953 use arbitrary::{Arbitrary, Unstructured};
9954 let mut buf = [0u8; 1024];
9955 rng.fill_bytes(&mut buf);
9956 let mut unstructured = Unstructured::new(&buf);
9957 Self::arbitrary(&mut unstructured).unwrap_or_default()
9958 }
9959}
9960impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
9961 fn default() -> Self {
9962 Self::DEFAULT.clone()
9963 }
9964}
9965impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
9966 type Message = MavMessage;
9967 const ID: u32 = 130u32;
9968 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
9969 const EXTRA_CRC: u8 = 29u8;
9970 const ENCODED_LEN: usize = 13usize;
9971 fn deser(
9972 _version: MavlinkVersion,
9973 __input: &[u8],
9974 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9975 let avail_len = __input.len();
9976 let mut payload_buf = [0; Self::ENCODED_LEN];
9977 let mut buf = if avail_len < Self::ENCODED_LEN {
9978 payload_buf[0..avail_len].copy_from_slice(__input);
9979 Bytes::new(&payload_buf)
9980 } else {
9981 Bytes::new(__input)
9982 };
9983 let mut __struct = Self::default();
9984 __struct.size = buf.get_u32_le();
9985 __struct.width = buf.get_u16_le();
9986 __struct.height = buf.get_u16_le();
9987 __struct.packets = buf.get_u16_le();
9988 let tmp = buf.get_u8();
9989 __struct.mavtype =
9990 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9991 enum_type: "MavlinkDataStreamType",
9992 value: tmp as u32,
9993 })?;
9994 __struct.payload = buf.get_u8();
9995 __struct.jpg_quality = buf.get_u8();
9996 Ok(__struct)
9997 }
9998 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9999 let mut __tmp = BytesMut::new(bytes);
10000 #[allow(clippy::absurd_extreme_comparisons)]
10001 #[allow(unused_comparisons)]
10002 if __tmp.remaining() < Self::ENCODED_LEN {
10003 panic!(
10004 "buffer is too small (need {} bytes, but got {})",
10005 Self::ENCODED_LEN,
10006 __tmp.remaining(),
10007 )
10008 }
10009 __tmp.put_u32_le(self.size);
10010 __tmp.put_u16_le(self.width);
10011 __tmp.put_u16_le(self.height);
10012 __tmp.put_u16_le(self.packets);
10013 __tmp.put_u8(self.mavtype as u8);
10014 __tmp.put_u8(self.payload);
10015 __tmp.put_u8(self.jpg_quality);
10016 if matches!(version, MavlinkVersion::V2) {
10017 let len = __tmp.len();
10018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10019 } else {
10020 __tmp.len()
10021 }
10022 }
10023}
10024#[doc = "id: 254"]
10025#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10026#[derive(Debug, Clone, PartialEq)]
10027#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10029pub struct DEBUG_DATA {
10030 #[doc = "Timestamp (time since system boot)."]
10031 pub time_boot_ms: u32,
10032 #[doc = "DEBUG value"]
10033 pub value: f32,
10034 #[doc = "index of debug variable"]
10035 pub ind: u8,
10036}
10037impl DEBUG_DATA {
10038 pub const ENCODED_LEN: usize = 9usize;
10039 pub const DEFAULT: Self = Self {
10040 time_boot_ms: 0_u32,
10041 value: 0.0_f32,
10042 ind: 0_u8,
10043 };
10044 #[cfg(feature = "arbitrary")]
10045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10046 use arbitrary::{Arbitrary, Unstructured};
10047 let mut buf = [0u8; 1024];
10048 rng.fill_bytes(&mut buf);
10049 let mut unstructured = Unstructured::new(&buf);
10050 Self::arbitrary(&mut unstructured).unwrap_or_default()
10051 }
10052}
10053impl Default for DEBUG_DATA {
10054 fn default() -> Self {
10055 Self::DEFAULT.clone()
10056 }
10057}
10058impl MessageData for DEBUG_DATA {
10059 type Message = MavMessage;
10060 const ID: u32 = 254u32;
10061 const NAME: &'static str = "DEBUG";
10062 const EXTRA_CRC: u8 = 46u8;
10063 const ENCODED_LEN: usize = 9usize;
10064 fn deser(
10065 _version: MavlinkVersion,
10066 __input: &[u8],
10067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10068 let avail_len = __input.len();
10069 let mut payload_buf = [0; Self::ENCODED_LEN];
10070 let mut buf = if avail_len < Self::ENCODED_LEN {
10071 payload_buf[0..avail_len].copy_from_slice(__input);
10072 Bytes::new(&payload_buf)
10073 } else {
10074 Bytes::new(__input)
10075 };
10076 let mut __struct = Self::default();
10077 __struct.time_boot_ms = buf.get_u32_le();
10078 __struct.value = buf.get_f32_le();
10079 __struct.ind = buf.get_u8();
10080 Ok(__struct)
10081 }
10082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10083 let mut __tmp = BytesMut::new(bytes);
10084 #[allow(clippy::absurd_extreme_comparisons)]
10085 #[allow(unused_comparisons)]
10086 if __tmp.remaining() < Self::ENCODED_LEN {
10087 panic!(
10088 "buffer is too small (need {} bytes, but got {})",
10089 Self::ENCODED_LEN,
10090 __tmp.remaining(),
10091 )
10092 }
10093 __tmp.put_u32_le(self.time_boot_ms);
10094 __tmp.put_f32_le(self.value);
10095 __tmp.put_u8(self.ind);
10096 if matches!(version, MavlinkVersion::V2) {
10097 let len = __tmp.len();
10098 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10099 } else {
10100 __tmp.len()
10101 }
10102 }
10103}
10104#[doc = "id: 350"]
10105#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10106#[derive(Debug, Clone, PartialEq)]
10107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10109pub struct DEBUG_FLOAT_ARRAY_DATA {
10110 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10111 pub time_usec: u64,
10112 #[doc = "Unique ID used to discriminate between arrays"]
10113 pub array_id: u16,
10114 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10115 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10116 pub name: [u8; 10],
10117 #[doc = "data"]
10118 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10119 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10120 pub data: [f32; 58],
10121}
10122impl DEBUG_FLOAT_ARRAY_DATA {
10123 pub const ENCODED_LEN: usize = 252usize;
10124 pub const DEFAULT: Self = Self {
10125 time_usec: 0_u64,
10126 array_id: 0_u16,
10127 name: [0_u8; 10usize],
10128 data: [0.0_f32; 58usize],
10129 };
10130 #[cfg(feature = "arbitrary")]
10131 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10132 use arbitrary::{Arbitrary, Unstructured};
10133 let mut buf = [0u8; 1024];
10134 rng.fill_bytes(&mut buf);
10135 let mut unstructured = Unstructured::new(&buf);
10136 Self::arbitrary(&mut unstructured).unwrap_or_default()
10137 }
10138}
10139impl Default for DEBUG_FLOAT_ARRAY_DATA {
10140 fn default() -> Self {
10141 Self::DEFAULT.clone()
10142 }
10143}
10144impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10145 type Message = MavMessage;
10146 const ID: u32 = 350u32;
10147 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10148 const EXTRA_CRC: u8 = 232u8;
10149 const ENCODED_LEN: usize = 252usize;
10150 fn deser(
10151 _version: MavlinkVersion,
10152 __input: &[u8],
10153 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10154 let avail_len = __input.len();
10155 let mut payload_buf = [0; Self::ENCODED_LEN];
10156 let mut buf = if avail_len < Self::ENCODED_LEN {
10157 payload_buf[0..avail_len].copy_from_slice(__input);
10158 Bytes::new(&payload_buf)
10159 } else {
10160 Bytes::new(__input)
10161 };
10162 let mut __struct = Self::default();
10163 __struct.time_usec = buf.get_u64_le();
10164 __struct.array_id = buf.get_u16_le();
10165 for v in &mut __struct.name {
10166 let val = buf.get_u8();
10167 *v = val;
10168 }
10169 for v in &mut __struct.data {
10170 let val = buf.get_f32_le();
10171 *v = val;
10172 }
10173 Ok(__struct)
10174 }
10175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10176 let mut __tmp = BytesMut::new(bytes);
10177 #[allow(clippy::absurd_extreme_comparisons)]
10178 #[allow(unused_comparisons)]
10179 if __tmp.remaining() < Self::ENCODED_LEN {
10180 panic!(
10181 "buffer is too small (need {} bytes, but got {})",
10182 Self::ENCODED_LEN,
10183 __tmp.remaining(),
10184 )
10185 }
10186 __tmp.put_u64_le(self.time_usec);
10187 __tmp.put_u16_le(self.array_id);
10188 for val in &self.name {
10189 __tmp.put_u8(*val);
10190 }
10191 for val in &self.data {
10192 __tmp.put_f32_le(*val);
10193 }
10194 if matches!(version, MavlinkVersion::V2) {
10195 let len = __tmp.len();
10196 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10197 } else {
10198 __tmp.len()
10199 }
10200 }
10201}
10202#[doc = "id: 250"]
10203#[doc = "To debug something using a named 3D vector."]
10204#[derive(Debug, Clone, PartialEq)]
10205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10207pub struct DEBUG_VECT_DATA {
10208 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10209 pub time_usec: u64,
10210 #[doc = "x"]
10211 pub x: f32,
10212 #[doc = "y"]
10213 pub y: f32,
10214 #[doc = "z"]
10215 pub z: f32,
10216 #[doc = "Name"]
10217 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10218 pub name: [u8; 10],
10219}
10220impl DEBUG_VECT_DATA {
10221 pub const ENCODED_LEN: usize = 30usize;
10222 pub const DEFAULT: Self = Self {
10223 time_usec: 0_u64,
10224 x: 0.0_f32,
10225 y: 0.0_f32,
10226 z: 0.0_f32,
10227 name: [0_u8; 10usize],
10228 };
10229 #[cfg(feature = "arbitrary")]
10230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10231 use arbitrary::{Arbitrary, Unstructured};
10232 let mut buf = [0u8; 1024];
10233 rng.fill_bytes(&mut buf);
10234 let mut unstructured = Unstructured::new(&buf);
10235 Self::arbitrary(&mut unstructured).unwrap_or_default()
10236 }
10237}
10238impl Default for DEBUG_VECT_DATA {
10239 fn default() -> Self {
10240 Self::DEFAULT.clone()
10241 }
10242}
10243impl MessageData for DEBUG_VECT_DATA {
10244 type Message = MavMessage;
10245 const ID: u32 = 250u32;
10246 const NAME: &'static str = "DEBUG_VECT";
10247 const EXTRA_CRC: u8 = 49u8;
10248 const ENCODED_LEN: usize = 30usize;
10249 fn deser(
10250 _version: MavlinkVersion,
10251 __input: &[u8],
10252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10253 let avail_len = __input.len();
10254 let mut payload_buf = [0; Self::ENCODED_LEN];
10255 let mut buf = if avail_len < Self::ENCODED_LEN {
10256 payload_buf[0..avail_len].copy_from_slice(__input);
10257 Bytes::new(&payload_buf)
10258 } else {
10259 Bytes::new(__input)
10260 };
10261 let mut __struct = Self::default();
10262 __struct.time_usec = buf.get_u64_le();
10263 __struct.x = buf.get_f32_le();
10264 __struct.y = buf.get_f32_le();
10265 __struct.z = buf.get_f32_le();
10266 for v in &mut __struct.name {
10267 let val = buf.get_u8();
10268 *v = val;
10269 }
10270 Ok(__struct)
10271 }
10272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10273 let mut __tmp = BytesMut::new(bytes);
10274 #[allow(clippy::absurd_extreme_comparisons)]
10275 #[allow(unused_comparisons)]
10276 if __tmp.remaining() < Self::ENCODED_LEN {
10277 panic!(
10278 "buffer is too small (need {} bytes, but got {})",
10279 Self::ENCODED_LEN,
10280 __tmp.remaining(),
10281 )
10282 }
10283 __tmp.put_u64_le(self.time_usec);
10284 __tmp.put_f32_le(self.x);
10285 __tmp.put_f32_le(self.y);
10286 __tmp.put_f32_le(self.z);
10287 for val in &self.name {
10288 __tmp.put_u8(*val);
10289 }
10290 if matches!(version, MavlinkVersion::V2) {
10291 let len = __tmp.len();
10292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10293 } else {
10294 __tmp.len()
10295 }
10296 }
10297}
10298#[doc = "id: 132"]
10299#[doc = "Distance sensor information for an onboard rangefinder."]
10300#[derive(Debug, Clone, PartialEq)]
10301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10303pub struct DISTANCE_SENSOR_DATA {
10304 #[doc = "Timestamp (time since system boot)."]
10305 pub time_boot_ms: u32,
10306 #[doc = "Minimum distance the sensor can measure"]
10307 pub min_distance: u16,
10308 #[doc = "Maximum distance the sensor can measure"]
10309 pub max_distance: u16,
10310 #[doc = "Current distance reading"]
10311 pub current_distance: u16,
10312 #[doc = "Type of distance sensor."]
10313 pub mavtype: MavDistanceSensor,
10314 #[doc = "Onboard ID of the sensor"]
10315 pub id: u8,
10316 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10317 pub orientation: MavSensorOrientation,
10318 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10319 pub covariance: u8,
10320 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10321 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10322 pub horizontal_fov: f32,
10323 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10324 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10325 pub vertical_fov: f32,
10326 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10327 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10328 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10329 pub quaternion: [f32; 4],
10330 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10331 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10332 pub signal_quality: u8,
10333}
10334impl DISTANCE_SENSOR_DATA {
10335 pub const ENCODED_LEN: usize = 39usize;
10336 pub const DEFAULT: Self = Self {
10337 time_boot_ms: 0_u32,
10338 min_distance: 0_u16,
10339 max_distance: 0_u16,
10340 current_distance: 0_u16,
10341 mavtype: MavDistanceSensor::DEFAULT,
10342 id: 0_u8,
10343 orientation: MavSensorOrientation::DEFAULT,
10344 covariance: 0_u8,
10345 horizontal_fov: 0.0_f32,
10346 vertical_fov: 0.0_f32,
10347 quaternion: [0.0_f32; 4usize],
10348 signal_quality: 0_u8,
10349 };
10350 #[cfg(feature = "arbitrary")]
10351 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10352 use arbitrary::{Arbitrary, Unstructured};
10353 let mut buf = [0u8; 1024];
10354 rng.fill_bytes(&mut buf);
10355 let mut unstructured = Unstructured::new(&buf);
10356 Self::arbitrary(&mut unstructured).unwrap_or_default()
10357 }
10358}
10359impl Default for DISTANCE_SENSOR_DATA {
10360 fn default() -> Self {
10361 Self::DEFAULT.clone()
10362 }
10363}
10364impl MessageData for DISTANCE_SENSOR_DATA {
10365 type Message = MavMessage;
10366 const ID: u32 = 132u32;
10367 const NAME: &'static str = "DISTANCE_SENSOR";
10368 const EXTRA_CRC: u8 = 85u8;
10369 const ENCODED_LEN: usize = 39usize;
10370 fn deser(
10371 _version: MavlinkVersion,
10372 __input: &[u8],
10373 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10374 let avail_len = __input.len();
10375 let mut payload_buf = [0; Self::ENCODED_LEN];
10376 let mut buf = if avail_len < Self::ENCODED_LEN {
10377 payload_buf[0..avail_len].copy_from_slice(__input);
10378 Bytes::new(&payload_buf)
10379 } else {
10380 Bytes::new(__input)
10381 };
10382 let mut __struct = Self::default();
10383 __struct.time_boot_ms = buf.get_u32_le();
10384 __struct.min_distance = buf.get_u16_le();
10385 __struct.max_distance = buf.get_u16_le();
10386 __struct.current_distance = buf.get_u16_le();
10387 let tmp = buf.get_u8();
10388 __struct.mavtype =
10389 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10390 enum_type: "MavDistanceSensor",
10391 value: tmp as u32,
10392 })?;
10393 __struct.id = buf.get_u8();
10394 let tmp = buf.get_u8();
10395 __struct.orientation =
10396 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10397 enum_type: "MavSensorOrientation",
10398 value: tmp as u32,
10399 })?;
10400 __struct.covariance = buf.get_u8();
10401 __struct.horizontal_fov = buf.get_f32_le();
10402 __struct.vertical_fov = buf.get_f32_le();
10403 for v in &mut __struct.quaternion {
10404 let val = buf.get_f32_le();
10405 *v = val;
10406 }
10407 __struct.signal_quality = buf.get_u8();
10408 Ok(__struct)
10409 }
10410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10411 let mut __tmp = BytesMut::new(bytes);
10412 #[allow(clippy::absurd_extreme_comparisons)]
10413 #[allow(unused_comparisons)]
10414 if __tmp.remaining() < Self::ENCODED_LEN {
10415 panic!(
10416 "buffer is too small (need {} bytes, but got {})",
10417 Self::ENCODED_LEN,
10418 __tmp.remaining(),
10419 )
10420 }
10421 __tmp.put_u32_le(self.time_boot_ms);
10422 __tmp.put_u16_le(self.min_distance);
10423 __tmp.put_u16_le(self.max_distance);
10424 __tmp.put_u16_le(self.current_distance);
10425 __tmp.put_u8(self.mavtype as u8);
10426 __tmp.put_u8(self.id);
10427 __tmp.put_u8(self.orientation as u8);
10428 __tmp.put_u8(self.covariance);
10429 __tmp.put_f32_le(self.horizontal_fov);
10430 __tmp.put_f32_le(self.vertical_fov);
10431 for val in &self.quaternion {
10432 __tmp.put_f32_le(*val);
10433 }
10434 __tmp.put_u8(self.signal_quality);
10435 if matches!(version, MavlinkVersion::V2) {
10436 let len = __tmp.len();
10437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10438 } else {
10439 __tmp.len()
10440 }
10441 }
10442}
10443#[doc = "id: 225"]
10444#[doc = "EFI status output."]
10445#[derive(Debug, Clone, PartialEq)]
10446#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10447#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10448pub struct EFI_STATUS_DATA {
10449 #[doc = "ECU index"]
10450 pub ecu_index: f32,
10451 #[doc = "RPM"]
10452 pub rpm: f32,
10453 #[doc = "Fuel consumed"]
10454 pub fuel_consumed: f32,
10455 #[doc = "Fuel flow rate"]
10456 pub fuel_flow: f32,
10457 #[doc = "Engine load"]
10458 pub engine_load: f32,
10459 #[doc = "Throttle position"]
10460 pub throttle_position: f32,
10461 #[doc = "Spark dwell time"]
10462 pub spark_dwell_time: f32,
10463 #[doc = "Barometric pressure"]
10464 pub barometric_pressure: f32,
10465 #[doc = "Intake manifold pressure("]
10466 pub intake_manifold_pressure: f32,
10467 #[doc = "Intake manifold temperature"]
10468 pub intake_manifold_temperature: f32,
10469 #[doc = "Cylinder head temperature"]
10470 pub cylinder_head_temperature: f32,
10471 #[doc = "Ignition timing (Crank angle degrees)"]
10472 pub ignition_timing: f32,
10473 #[doc = "Injection time"]
10474 pub injection_time: f32,
10475 #[doc = "Exhaust gas temperature"]
10476 pub exhaust_gas_temperature: f32,
10477 #[doc = "Output throttle"]
10478 pub throttle_out: f32,
10479 #[doc = "Pressure/temperature compensation"]
10480 pub pt_compensation: f32,
10481 #[doc = "EFI health status"]
10482 pub health: u8,
10483 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10484 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10485 pub ignition_voltage: f32,
10486 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10488 pub fuel_pressure: f32,
10489}
10490impl EFI_STATUS_DATA {
10491 pub const ENCODED_LEN: usize = 73usize;
10492 pub const DEFAULT: Self = Self {
10493 ecu_index: 0.0_f32,
10494 rpm: 0.0_f32,
10495 fuel_consumed: 0.0_f32,
10496 fuel_flow: 0.0_f32,
10497 engine_load: 0.0_f32,
10498 throttle_position: 0.0_f32,
10499 spark_dwell_time: 0.0_f32,
10500 barometric_pressure: 0.0_f32,
10501 intake_manifold_pressure: 0.0_f32,
10502 intake_manifold_temperature: 0.0_f32,
10503 cylinder_head_temperature: 0.0_f32,
10504 ignition_timing: 0.0_f32,
10505 injection_time: 0.0_f32,
10506 exhaust_gas_temperature: 0.0_f32,
10507 throttle_out: 0.0_f32,
10508 pt_compensation: 0.0_f32,
10509 health: 0_u8,
10510 ignition_voltage: 0.0_f32,
10511 fuel_pressure: 0.0_f32,
10512 };
10513 #[cfg(feature = "arbitrary")]
10514 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10515 use arbitrary::{Arbitrary, Unstructured};
10516 let mut buf = [0u8; 1024];
10517 rng.fill_bytes(&mut buf);
10518 let mut unstructured = Unstructured::new(&buf);
10519 Self::arbitrary(&mut unstructured).unwrap_or_default()
10520 }
10521}
10522impl Default for EFI_STATUS_DATA {
10523 fn default() -> Self {
10524 Self::DEFAULT.clone()
10525 }
10526}
10527impl MessageData for EFI_STATUS_DATA {
10528 type Message = MavMessage;
10529 const ID: u32 = 225u32;
10530 const NAME: &'static str = "EFI_STATUS";
10531 const EXTRA_CRC: u8 = 208u8;
10532 const ENCODED_LEN: usize = 73usize;
10533 fn deser(
10534 _version: MavlinkVersion,
10535 __input: &[u8],
10536 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10537 let avail_len = __input.len();
10538 let mut payload_buf = [0; Self::ENCODED_LEN];
10539 let mut buf = if avail_len < Self::ENCODED_LEN {
10540 payload_buf[0..avail_len].copy_from_slice(__input);
10541 Bytes::new(&payload_buf)
10542 } else {
10543 Bytes::new(__input)
10544 };
10545 let mut __struct = Self::default();
10546 __struct.ecu_index = buf.get_f32_le();
10547 __struct.rpm = buf.get_f32_le();
10548 __struct.fuel_consumed = buf.get_f32_le();
10549 __struct.fuel_flow = buf.get_f32_le();
10550 __struct.engine_load = buf.get_f32_le();
10551 __struct.throttle_position = buf.get_f32_le();
10552 __struct.spark_dwell_time = buf.get_f32_le();
10553 __struct.barometric_pressure = buf.get_f32_le();
10554 __struct.intake_manifold_pressure = buf.get_f32_le();
10555 __struct.intake_manifold_temperature = buf.get_f32_le();
10556 __struct.cylinder_head_temperature = buf.get_f32_le();
10557 __struct.ignition_timing = buf.get_f32_le();
10558 __struct.injection_time = buf.get_f32_le();
10559 __struct.exhaust_gas_temperature = buf.get_f32_le();
10560 __struct.throttle_out = buf.get_f32_le();
10561 __struct.pt_compensation = buf.get_f32_le();
10562 __struct.health = buf.get_u8();
10563 __struct.ignition_voltage = buf.get_f32_le();
10564 __struct.fuel_pressure = buf.get_f32_le();
10565 Ok(__struct)
10566 }
10567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10568 let mut __tmp = BytesMut::new(bytes);
10569 #[allow(clippy::absurd_extreme_comparisons)]
10570 #[allow(unused_comparisons)]
10571 if __tmp.remaining() < Self::ENCODED_LEN {
10572 panic!(
10573 "buffer is too small (need {} bytes, but got {})",
10574 Self::ENCODED_LEN,
10575 __tmp.remaining(),
10576 )
10577 }
10578 __tmp.put_f32_le(self.ecu_index);
10579 __tmp.put_f32_le(self.rpm);
10580 __tmp.put_f32_le(self.fuel_consumed);
10581 __tmp.put_f32_le(self.fuel_flow);
10582 __tmp.put_f32_le(self.engine_load);
10583 __tmp.put_f32_le(self.throttle_position);
10584 __tmp.put_f32_le(self.spark_dwell_time);
10585 __tmp.put_f32_le(self.barometric_pressure);
10586 __tmp.put_f32_le(self.intake_manifold_pressure);
10587 __tmp.put_f32_le(self.intake_manifold_temperature);
10588 __tmp.put_f32_le(self.cylinder_head_temperature);
10589 __tmp.put_f32_le(self.ignition_timing);
10590 __tmp.put_f32_le(self.injection_time);
10591 __tmp.put_f32_le(self.exhaust_gas_temperature);
10592 __tmp.put_f32_le(self.throttle_out);
10593 __tmp.put_f32_le(self.pt_compensation);
10594 __tmp.put_u8(self.health);
10595 __tmp.put_f32_le(self.ignition_voltage);
10596 __tmp.put_f32_le(self.fuel_pressure);
10597 if matches!(version, MavlinkVersion::V2) {
10598 let len = __tmp.len();
10599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10600 } else {
10601 __tmp.len()
10602 }
10603 }
10604}
10605#[doc = "id: 131"]
10606#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10607#[derive(Debug, Clone, PartialEq)]
10608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10610pub struct ENCAPSULATED_DATA_DATA {
10611 #[doc = "sequence number (starting with 0 on every transmission)"]
10612 pub seqnr: u16,
10613 #[doc = "image data bytes"]
10614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10615 pub data: [u8; 253],
10616}
10617impl ENCAPSULATED_DATA_DATA {
10618 pub const ENCODED_LEN: usize = 255usize;
10619 pub const DEFAULT: Self = Self {
10620 seqnr: 0_u16,
10621 data: [0_u8; 253usize],
10622 };
10623 #[cfg(feature = "arbitrary")]
10624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10625 use arbitrary::{Arbitrary, Unstructured};
10626 let mut buf = [0u8; 1024];
10627 rng.fill_bytes(&mut buf);
10628 let mut unstructured = Unstructured::new(&buf);
10629 Self::arbitrary(&mut unstructured).unwrap_or_default()
10630 }
10631}
10632impl Default for ENCAPSULATED_DATA_DATA {
10633 fn default() -> Self {
10634 Self::DEFAULT.clone()
10635 }
10636}
10637impl MessageData for ENCAPSULATED_DATA_DATA {
10638 type Message = MavMessage;
10639 const ID: u32 = 131u32;
10640 const NAME: &'static str = "ENCAPSULATED_DATA";
10641 const EXTRA_CRC: u8 = 223u8;
10642 const ENCODED_LEN: usize = 255usize;
10643 fn deser(
10644 _version: MavlinkVersion,
10645 __input: &[u8],
10646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10647 let avail_len = __input.len();
10648 let mut payload_buf = [0; Self::ENCODED_LEN];
10649 let mut buf = if avail_len < Self::ENCODED_LEN {
10650 payload_buf[0..avail_len].copy_from_slice(__input);
10651 Bytes::new(&payload_buf)
10652 } else {
10653 Bytes::new(__input)
10654 };
10655 let mut __struct = Self::default();
10656 __struct.seqnr = buf.get_u16_le();
10657 for v in &mut __struct.data {
10658 let val = buf.get_u8();
10659 *v = val;
10660 }
10661 Ok(__struct)
10662 }
10663 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10664 let mut __tmp = BytesMut::new(bytes);
10665 #[allow(clippy::absurd_extreme_comparisons)]
10666 #[allow(unused_comparisons)]
10667 if __tmp.remaining() < Self::ENCODED_LEN {
10668 panic!(
10669 "buffer is too small (need {} bytes, but got {})",
10670 Self::ENCODED_LEN,
10671 __tmp.remaining(),
10672 )
10673 }
10674 __tmp.put_u16_le(self.seqnr);
10675 for val in &self.data {
10676 __tmp.put_u8(*val);
10677 }
10678 if matches!(version, MavlinkVersion::V2) {
10679 let len = __tmp.len();
10680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10681 } else {
10682 __tmp.len()
10683 }
10684 }
10685}
10686#[doc = "id: 290"]
10687#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10688#[derive(Debug, Clone, PartialEq)]
10689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10691pub struct ESC_INFO_DATA {
10692 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10693 pub time_usec: u64,
10694 #[doc = "Number of reported errors by each ESC since boot."]
10695 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10696 pub error_count: [u32; 4],
10697 #[doc = "Counter of data packets received."]
10698 pub counter: u16,
10699 #[doc = "Bitmap of ESC failure flags."]
10700 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10701 pub failure_flags: [u16; 4],
10702 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
10703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10704 pub temperature: [i16; 4],
10705 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10706 pub index: u8,
10707 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
10708 pub count: u8,
10709 #[doc = "Connection type protocol for all ESC."]
10710 pub connection_type: EscConnectionType,
10711 #[doc = "Information regarding online/offline status of each ESC."]
10712 pub info: u8,
10713}
10714impl ESC_INFO_DATA {
10715 pub const ENCODED_LEN: usize = 46usize;
10716 pub const DEFAULT: Self = Self {
10717 time_usec: 0_u64,
10718 error_count: [0_u32; 4usize],
10719 counter: 0_u16,
10720 failure_flags: [0_u16; 4usize],
10721 temperature: [0_i16; 4usize],
10722 index: 0_u8,
10723 count: 0_u8,
10724 connection_type: EscConnectionType::DEFAULT,
10725 info: 0_u8,
10726 };
10727 #[cfg(feature = "arbitrary")]
10728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10729 use arbitrary::{Arbitrary, Unstructured};
10730 let mut buf = [0u8; 1024];
10731 rng.fill_bytes(&mut buf);
10732 let mut unstructured = Unstructured::new(&buf);
10733 Self::arbitrary(&mut unstructured).unwrap_or_default()
10734 }
10735}
10736impl Default for ESC_INFO_DATA {
10737 fn default() -> Self {
10738 Self::DEFAULT.clone()
10739 }
10740}
10741impl MessageData for ESC_INFO_DATA {
10742 type Message = MavMessage;
10743 const ID: u32 = 290u32;
10744 const NAME: &'static str = "ESC_INFO";
10745 const EXTRA_CRC: u8 = 251u8;
10746 const ENCODED_LEN: usize = 46usize;
10747 fn deser(
10748 _version: MavlinkVersion,
10749 __input: &[u8],
10750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10751 let avail_len = __input.len();
10752 let mut payload_buf = [0; Self::ENCODED_LEN];
10753 let mut buf = if avail_len < Self::ENCODED_LEN {
10754 payload_buf[0..avail_len].copy_from_slice(__input);
10755 Bytes::new(&payload_buf)
10756 } else {
10757 Bytes::new(__input)
10758 };
10759 let mut __struct = Self::default();
10760 __struct.time_usec = buf.get_u64_le();
10761 for v in &mut __struct.error_count {
10762 let val = buf.get_u32_le();
10763 *v = val;
10764 }
10765 __struct.counter = buf.get_u16_le();
10766 for v in &mut __struct.failure_flags {
10767 let val = buf.get_u16_le();
10768 *v = val;
10769 }
10770 for v in &mut __struct.temperature {
10771 let val = buf.get_i16_le();
10772 *v = val;
10773 }
10774 __struct.index = buf.get_u8();
10775 __struct.count = buf.get_u8();
10776 let tmp = buf.get_u8();
10777 __struct.connection_type =
10778 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10779 enum_type: "EscConnectionType",
10780 value: tmp as u32,
10781 })?;
10782 __struct.info = buf.get_u8();
10783 Ok(__struct)
10784 }
10785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10786 let mut __tmp = BytesMut::new(bytes);
10787 #[allow(clippy::absurd_extreme_comparisons)]
10788 #[allow(unused_comparisons)]
10789 if __tmp.remaining() < Self::ENCODED_LEN {
10790 panic!(
10791 "buffer is too small (need {} bytes, but got {})",
10792 Self::ENCODED_LEN,
10793 __tmp.remaining(),
10794 )
10795 }
10796 __tmp.put_u64_le(self.time_usec);
10797 for val in &self.error_count {
10798 __tmp.put_u32_le(*val);
10799 }
10800 __tmp.put_u16_le(self.counter);
10801 for val in &self.failure_flags {
10802 __tmp.put_u16_le(*val);
10803 }
10804 for val in &self.temperature {
10805 __tmp.put_i16_le(*val);
10806 }
10807 __tmp.put_u8(self.index);
10808 __tmp.put_u8(self.count);
10809 __tmp.put_u8(self.connection_type as u8);
10810 __tmp.put_u8(self.info);
10811 if matches!(version, MavlinkVersion::V2) {
10812 let len = __tmp.len();
10813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10814 } else {
10815 __tmp.len()
10816 }
10817 }
10818}
10819#[doc = "id: 291"]
10820#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
10821#[derive(Debug, Clone, PartialEq)]
10822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10824pub struct ESC_STATUS_DATA {
10825 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10826 pub time_usec: u64,
10827 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
10828 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10829 pub rpm: [i32; 4],
10830 #[doc = "Voltage measured from each ESC."]
10831 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10832 pub voltage: [f32; 4],
10833 #[doc = "Current measured from each ESC."]
10834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10835 pub current: [f32; 4],
10836 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10837 pub index: u8,
10838}
10839impl ESC_STATUS_DATA {
10840 pub const ENCODED_LEN: usize = 57usize;
10841 pub const DEFAULT: Self = Self {
10842 time_usec: 0_u64,
10843 rpm: [0_i32; 4usize],
10844 voltage: [0.0_f32; 4usize],
10845 current: [0.0_f32; 4usize],
10846 index: 0_u8,
10847 };
10848 #[cfg(feature = "arbitrary")]
10849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10850 use arbitrary::{Arbitrary, Unstructured};
10851 let mut buf = [0u8; 1024];
10852 rng.fill_bytes(&mut buf);
10853 let mut unstructured = Unstructured::new(&buf);
10854 Self::arbitrary(&mut unstructured).unwrap_or_default()
10855 }
10856}
10857impl Default for ESC_STATUS_DATA {
10858 fn default() -> Self {
10859 Self::DEFAULT.clone()
10860 }
10861}
10862impl MessageData for ESC_STATUS_DATA {
10863 type Message = MavMessage;
10864 const ID: u32 = 291u32;
10865 const NAME: &'static str = "ESC_STATUS";
10866 const EXTRA_CRC: u8 = 10u8;
10867 const ENCODED_LEN: usize = 57usize;
10868 fn deser(
10869 _version: MavlinkVersion,
10870 __input: &[u8],
10871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10872 let avail_len = __input.len();
10873 let mut payload_buf = [0; Self::ENCODED_LEN];
10874 let mut buf = if avail_len < Self::ENCODED_LEN {
10875 payload_buf[0..avail_len].copy_from_slice(__input);
10876 Bytes::new(&payload_buf)
10877 } else {
10878 Bytes::new(__input)
10879 };
10880 let mut __struct = Self::default();
10881 __struct.time_usec = buf.get_u64_le();
10882 for v in &mut __struct.rpm {
10883 let val = buf.get_i32_le();
10884 *v = val;
10885 }
10886 for v in &mut __struct.voltage {
10887 let val = buf.get_f32_le();
10888 *v = val;
10889 }
10890 for v in &mut __struct.current {
10891 let val = buf.get_f32_le();
10892 *v = val;
10893 }
10894 __struct.index = buf.get_u8();
10895 Ok(__struct)
10896 }
10897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10898 let mut __tmp = BytesMut::new(bytes);
10899 #[allow(clippy::absurd_extreme_comparisons)]
10900 #[allow(unused_comparisons)]
10901 if __tmp.remaining() < Self::ENCODED_LEN {
10902 panic!(
10903 "buffer is too small (need {} bytes, but got {})",
10904 Self::ENCODED_LEN,
10905 __tmp.remaining(),
10906 )
10907 }
10908 __tmp.put_u64_le(self.time_usec);
10909 for val in &self.rpm {
10910 __tmp.put_i32_le(*val);
10911 }
10912 for val in &self.voltage {
10913 __tmp.put_f32_le(*val);
10914 }
10915 for val in &self.current {
10916 __tmp.put_f32_le(*val);
10917 }
10918 __tmp.put_u8(self.index);
10919 if matches!(version, MavlinkVersion::V2) {
10920 let len = __tmp.len();
10921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10922 } else {
10923 __tmp.len()
10924 }
10925 }
10926}
10927#[doc = "id: 230"]
10928#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
10929#[derive(Debug, Clone, PartialEq)]
10930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10932pub struct ESTIMATOR_STATUS_DATA {
10933 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10934 pub time_usec: u64,
10935 #[doc = "Velocity innovation test ratio"]
10936 pub vel_ratio: f32,
10937 #[doc = "Horizontal position innovation test ratio"]
10938 pub pos_horiz_ratio: f32,
10939 #[doc = "Vertical position innovation test ratio"]
10940 pub pos_vert_ratio: f32,
10941 #[doc = "Magnetometer innovation test ratio"]
10942 pub mag_ratio: f32,
10943 #[doc = "Height above terrain innovation test ratio"]
10944 pub hagl_ratio: f32,
10945 #[doc = "True airspeed innovation test ratio"]
10946 pub tas_ratio: f32,
10947 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
10948 pub pos_horiz_accuracy: f32,
10949 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
10950 pub pos_vert_accuracy: f32,
10951 #[doc = "Bitmap indicating which EKF outputs are valid."]
10952 pub flags: EstimatorStatusFlags,
10953}
10954impl ESTIMATOR_STATUS_DATA {
10955 pub const ENCODED_LEN: usize = 42usize;
10956 pub const DEFAULT: Self = Self {
10957 time_usec: 0_u64,
10958 vel_ratio: 0.0_f32,
10959 pos_horiz_ratio: 0.0_f32,
10960 pos_vert_ratio: 0.0_f32,
10961 mag_ratio: 0.0_f32,
10962 hagl_ratio: 0.0_f32,
10963 tas_ratio: 0.0_f32,
10964 pos_horiz_accuracy: 0.0_f32,
10965 pos_vert_accuracy: 0.0_f32,
10966 flags: EstimatorStatusFlags::DEFAULT,
10967 };
10968 #[cfg(feature = "arbitrary")]
10969 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10970 use arbitrary::{Arbitrary, Unstructured};
10971 let mut buf = [0u8; 1024];
10972 rng.fill_bytes(&mut buf);
10973 let mut unstructured = Unstructured::new(&buf);
10974 Self::arbitrary(&mut unstructured).unwrap_or_default()
10975 }
10976}
10977impl Default for ESTIMATOR_STATUS_DATA {
10978 fn default() -> Self {
10979 Self::DEFAULT.clone()
10980 }
10981}
10982impl MessageData for ESTIMATOR_STATUS_DATA {
10983 type Message = MavMessage;
10984 const ID: u32 = 230u32;
10985 const NAME: &'static str = "ESTIMATOR_STATUS";
10986 const EXTRA_CRC: u8 = 163u8;
10987 const ENCODED_LEN: usize = 42usize;
10988 fn deser(
10989 _version: MavlinkVersion,
10990 __input: &[u8],
10991 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10992 let avail_len = __input.len();
10993 let mut payload_buf = [0; Self::ENCODED_LEN];
10994 let mut buf = if avail_len < Self::ENCODED_LEN {
10995 payload_buf[0..avail_len].copy_from_slice(__input);
10996 Bytes::new(&payload_buf)
10997 } else {
10998 Bytes::new(__input)
10999 };
11000 let mut __struct = Self::default();
11001 __struct.time_usec = buf.get_u64_le();
11002 __struct.vel_ratio = buf.get_f32_le();
11003 __struct.pos_horiz_ratio = buf.get_f32_le();
11004 __struct.pos_vert_ratio = buf.get_f32_le();
11005 __struct.mag_ratio = buf.get_f32_le();
11006 __struct.hagl_ratio = buf.get_f32_le();
11007 __struct.tas_ratio = buf.get_f32_le();
11008 __struct.pos_horiz_accuracy = buf.get_f32_le();
11009 __struct.pos_vert_accuracy = buf.get_f32_le();
11010 let tmp = buf.get_u16_le();
11011 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11012 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11013 flag_type: "EstimatorStatusFlags",
11014 value: tmp as u32,
11015 })?;
11016 Ok(__struct)
11017 }
11018 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11019 let mut __tmp = BytesMut::new(bytes);
11020 #[allow(clippy::absurd_extreme_comparisons)]
11021 #[allow(unused_comparisons)]
11022 if __tmp.remaining() < Self::ENCODED_LEN {
11023 panic!(
11024 "buffer is too small (need {} bytes, but got {})",
11025 Self::ENCODED_LEN,
11026 __tmp.remaining(),
11027 )
11028 }
11029 __tmp.put_u64_le(self.time_usec);
11030 __tmp.put_f32_le(self.vel_ratio);
11031 __tmp.put_f32_le(self.pos_horiz_ratio);
11032 __tmp.put_f32_le(self.pos_vert_ratio);
11033 __tmp.put_f32_le(self.mag_ratio);
11034 __tmp.put_f32_le(self.hagl_ratio);
11035 __tmp.put_f32_le(self.tas_ratio);
11036 __tmp.put_f32_le(self.pos_horiz_accuracy);
11037 __tmp.put_f32_le(self.pos_vert_accuracy);
11038 __tmp.put_u16_le(self.flags.bits());
11039 if matches!(version, MavlinkVersion::V2) {
11040 let len = __tmp.len();
11041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11042 } else {
11043 __tmp.len()
11044 }
11045 }
11046}
11047#[doc = "id: 410"]
11048#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11049#[derive(Debug, Clone, PartialEq)]
11050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11052pub struct EVENT_DATA {
11053 #[doc = "Event ID (as defined in the component metadata)"]
11054 pub id: u32,
11055 #[doc = "Timestamp (time since system boot when the event happened)."]
11056 pub event_time_boot_ms: u32,
11057 #[doc = "Sequence number."]
11058 pub sequence: u16,
11059 #[doc = "Component ID"]
11060 pub destination_component: u8,
11061 #[doc = "System ID"]
11062 pub destination_system: u8,
11063 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11064 pub log_levels: u8,
11065 #[doc = "Arguments (depend on event ID)."]
11066 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11067 pub arguments: [u8; 40],
11068}
11069impl EVENT_DATA {
11070 pub const ENCODED_LEN: usize = 53usize;
11071 pub const DEFAULT: Self = Self {
11072 id: 0_u32,
11073 event_time_boot_ms: 0_u32,
11074 sequence: 0_u16,
11075 destination_component: 0_u8,
11076 destination_system: 0_u8,
11077 log_levels: 0_u8,
11078 arguments: [0_u8; 40usize],
11079 };
11080 #[cfg(feature = "arbitrary")]
11081 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11082 use arbitrary::{Arbitrary, Unstructured};
11083 let mut buf = [0u8; 1024];
11084 rng.fill_bytes(&mut buf);
11085 let mut unstructured = Unstructured::new(&buf);
11086 Self::arbitrary(&mut unstructured).unwrap_or_default()
11087 }
11088}
11089impl Default for EVENT_DATA {
11090 fn default() -> Self {
11091 Self::DEFAULT.clone()
11092 }
11093}
11094impl MessageData for EVENT_DATA {
11095 type Message = MavMessage;
11096 const ID: u32 = 410u32;
11097 const NAME: &'static str = "EVENT";
11098 const EXTRA_CRC: u8 = 160u8;
11099 const ENCODED_LEN: usize = 53usize;
11100 fn deser(
11101 _version: MavlinkVersion,
11102 __input: &[u8],
11103 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11104 let avail_len = __input.len();
11105 let mut payload_buf = [0; Self::ENCODED_LEN];
11106 let mut buf = if avail_len < Self::ENCODED_LEN {
11107 payload_buf[0..avail_len].copy_from_slice(__input);
11108 Bytes::new(&payload_buf)
11109 } else {
11110 Bytes::new(__input)
11111 };
11112 let mut __struct = Self::default();
11113 __struct.id = buf.get_u32_le();
11114 __struct.event_time_boot_ms = buf.get_u32_le();
11115 __struct.sequence = buf.get_u16_le();
11116 __struct.destination_component = buf.get_u8();
11117 __struct.destination_system = buf.get_u8();
11118 __struct.log_levels = buf.get_u8();
11119 for v in &mut __struct.arguments {
11120 let val = buf.get_u8();
11121 *v = val;
11122 }
11123 Ok(__struct)
11124 }
11125 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11126 let mut __tmp = BytesMut::new(bytes);
11127 #[allow(clippy::absurd_extreme_comparisons)]
11128 #[allow(unused_comparisons)]
11129 if __tmp.remaining() < Self::ENCODED_LEN {
11130 panic!(
11131 "buffer is too small (need {} bytes, but got {})",
11132 Self::ENCODED_LEN,
11133 __tmp.remaining(),
11134 )
11135 }
11136 __tmp.put_u32_le(self.id);
11137 __tmp.put_u32_le(self.event_time_boot_ms);
11138 __tmp.put_u16_le(self.sequence);
11139 __tmp.put_u8(self.destination_component);
11140 __tmp.put_u8(self.destination_system);
11141 __tmp.put_u8(self.log_levels);
11142 for val in &self.arguments {
11143 __tmp.put_u8(*val);
11144 }
11145 if matches!(version, MavlinkVersion::V2) {
11146 let len = __tmp.len();
11147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11148 } else {
11149 __tmp.len()
11150 }
11151 }
11152}
11153#[doc = "id: 245"]
11154#[doc = "Provides state for additional features."]
11155#[derive(Debug, Clone, PartialEq)]
11156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11158pub struct EXTENDED_SYS_STATE_DATA {
11159 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11160 pub vtol_state: MavVtolState,
11161 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11162 pub landed_state: MavLandedState,
11163}
11164impl EXTENDED_SYS_STATE_DATA {
11165 pub const ENCODED_LEN: usize = 2usize;
11166 pub const DEFAULT: Self = Self {
11167 vtol_state: MavVtolState::DEFAULT,
11168 landed_state: MavLandedState::DEFAULT,
11169 };
11170 #[cfg(feature = "arbitrary")]
11171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11172 use arbitrary::{Arbitrary, Unstructured};
11173 let mut buf = [0u8; 1024];
11174 rng.fill_bytes(&mut buf);
11175 let mut unstructured = Unstructured::new(&buf);
11176 Self::arbitrary(&mut unstructured).unwrap_or_default()
11177 }
11178}
11179impl Default for EXTENDED_SYS_STATE_DATA {
11180 fn default() -> Self {
11181 Self::DEFAULT.clone()
11182 }
11183}
11184impl MessageData for EXTENDED_SYS_STATE_DATA {
11185 type Message = MavMessage;
11186 const ID: u32 = 245u32;
11187 const NAME: &'static str = "EXTENDED_SYS_STATE";
11188 const EXTRA_CRC: u8 = 130u8;
11189 const ENCODED_LEN: usize = 2usize;
11190 fn deser(
11191 _version: MavlinkVersion,
11192 __input: &[u8],
11193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11194 let avail_len = __input.len();
11195 let mut payload_buf = [0; Self::ENCODED_LEN];
11196 let mut buf = if avail_len < Self::ENCODED_LEN {
11197 payload_buf[0..avail_len].copy_from_slice(__input);
11198 Bytes::new(&payload_buf)
11199 } else {
11200 Bytes::new(__input)
11201 };
11202 let mut __struct = Self::default();
11203 let tmp = buf.get_u8();
11204 __struct.vtol_state =
11205 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11206 enum_type: "MavVtolState",
11207 value: tmp as u32,
11208 })?;
11209 let tmp = buf.get_u8();
11210 __struct.landed_state =
11211 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11212 enum_type: "MavLandedState",
11213 value: tmp as u32,
11214 })?;
11215 Ok(__struct)
11216 }
11217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11218 let mut __tmp = BytesMut::new(bytes);
11219 #[allow(clippy::absurd_extreme_comparisons)]
11220 #[allow(unused_comparisons)]
11221 if __tmp.remaining() < Self::ENCODED_LEN {
11222 panic!(
11223 "buffer is too small (need {} bytes, but got {})",
11224 Self::ENCODED_LEN,
11225 __tmp.remaining(),
11226 )
11227 }
11228 __tmp.put_u8(self.vtol_state as u8);
11229 __tmp.put_u8(self.landed_state as u8);
11230 if matches!(version, MavlinkVersion::V2) {
11231 let len = __tmp.len();
11232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11233 } else {
11234 __tmp.len()
11235 }
11236 }
11237}
11238#[doc = "id: 162"]
11239#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11240#[derive(Debug, Clone, PartialEq)]
11241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11243pub struct FENCE_STATUS_DATA {
11244 #[doc = "Time (since boot) of last breach."]
11245 pub breach_time: u32,
11246 #[doc = "Number of fence breaches."]
11247 pub breach_count: u16,
11248 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11249 pub breach_status: u8,
11250 #[doc = "Last breach type."]
11251 pub breach_type: FenceBreach,
11252 #[doc = "Active action to prevent fence breach"]
11253 #[cfg_attr(feature = "serde", serde(default))]
11254 pub breach_mitigation: FenceMitigate,
11255}
11256impl FENCE_STATUS_DATA {
11257 pub const ENCODED_LEN: usize = 9usize;
11258 pub const DEFAULT: Self = Self {
11259 breach_time: 0_u32,
11260 breach_count: 0_u16,
11261 breach_status: 0_u8,
11262 breach_type: FenceBreach::DEFAULT,
11263 breach_mitigation: FenceMitigate::DEFAULT,
11264 };
11265 #[cfg(feature = "arbitrary")]
11266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11267 use arbitrary::{Arbitrary, Unstructured};
11268 let mut buf = [0u8; 1024];
11269 rng.fill_bytes(&mut buf);
11270 let mut unstructured = Unstructured::new(&buf);
11271 Self::arbitrary(&mut unstructured).unwrap_or_default()
11272 }
11273}
11274impl Default for FENCE_STATUS_DATA {
11275 fn default() -> Self {
11276 Self::DEFAULT.clone()
11277 }
11278}
11279impl MessageData for FENCE_STATUS_DATA {
11280 type Message = MavMessage;
11281 const ID: u32 = 162u32;
11282 const NAME: &'static str = "FENCE_STATUS";
11283 const EXTRA_CRC: u8 = 189u8;
11284 const ENCODED_LEN: usize = 9usize;
11285 fn deser(
11286 _version: MavlinkVersion,
11287 __input: &[u8],
11288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11289 let avail_len = __input.len();
11290 let mut payload_buf = [0; Self::ENCODED_LEN];
11291 let mut buf = if avail_len < Self::ENCODED_LEN {
11292 payload_buf[0..avail_len].copy_from_slice(__input);
11293 Bytes::new(&payload_buf)
11294 } else {
11295 Bytes::new(__input)
11296 };
11297 let mut __struct = Self::default();
11298 __struct.breach_time = buf.get_u32_le();
11299 __struct.breach_count = buf.get_u16_le();
11300 __struct.breach_status = buf.get_u8();
11301 let tmp = buf.get_u8();
11302 __struct.breach_type =
11303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11304 enum_type: "FenceBreach",
11305 value: tmp as u32,
11306 })?;
11307 let tmp = buf.get_u8();
11308 __struct.breach_mitigation =
11309 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11310 enum_type: "FenceMitigate",
11311 value: tmp as u32,
11312 })?;
11313 Ok(__struct)
11314 }
11315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11316 let mut __tmp = BytesMut::new(bytes);
11317 #[allow(clippy::absurd_extreme_comparisons)]
11318 #[allow(unused_comparisons)]
11319 if __tmp.remaining() < Self::ENCODED_LEN {
11320 panic!(
11321 "buffer is too small (need {} bytes, but got {})",
11322 Self::ENCODED_LEN,
11323 __tmp.remaining(),
11324 )
11325 }
11326 __tmp.put_u32_le(self.breach_time);
11327 __tmp.put_u16_le(self.breach_count);
11328 __tmp.put_u8(self.breach_status);
11329 __tmp.put_u8(self.breach_type as u8);
11330 __tmp.put_u8(self.breach_mitigation as u8);
11331 if matches!(version, MavlinkVersion::V2) {
11332 let len = __tmp.len();
11333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11334 } else {
11335 __tmp.len()
11336 }
11337 }
11338}
11339#[doc = "id: 110"]
11340#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11341#[derive(Debug, Clone, PartialEq)]
11342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11344pub struct FILE_TRANSFER_PROTOCOL_DATA {
11345 #[doc = "Network ID (0 for broadcast)"]
11346 pub target_network: u8,
11347 #[doc = "System ID (0 for broadcast)"]
11348 pub target_system: u8,
11349 #[doc = "Component ID (0 for broadcast)"]
11350 pub target_component: u8,
11351 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11352 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11353 pub payload: [u8; 251],
11354}
11355impl FILE_TRANSFER_PROTOCOL_DATA {
11356 pub const ENCODED_LEN: usize = 254usize;
11357 pub const DEFAULT: Self = Self {
11358 target_network: 0_u8,
11359 target_system: 0_u8,
11360 target_component: 0_u8,
11361 payload: [0_u8; 251usize],
11362 };
11363 #[cfg(feature = "arbitrary")]
11364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11365 use arbitrary::{Arbitrary, Unstructured};
11366 let mut buf = [0u8; 1024];
11367 rng.fill_bytes(&mut buf);
11368 let mut unstructured = Unstructured::new(&buf);
11369 Self::arbitrary(&mut unstructured).unwrap_or_default()
11370 }
11371}
11372impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11373 fn default() -> Self {
11374 Self::DEFAULT.clone()
11375 }
11376}
11377impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11378 type Message = MavMessage;
11379 const ID: u32 = 110u32;
11380 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11381 const EXTRA_CRC: u8 = 84u8;
11382 const ENCODED_LEN: usize = 254usize;
11383 fn deser(
11384 _version: MavlinkVersion,
11385 __input: &[u8],
11386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11387 let avail_len = __input.len();
11388 let mut payload_buf = [0; Self::ENCODED_LEN];
11389 let mut buf = if avail_len < Self::ENCODED_LEN {
11390 payload_buf[0..avail_len].copy_from_slice(__input);
11391 Bytes::new(&payload_buf)
11392 } else {
11393 Bytes::new(__input)
11394 };
11395 let mut __struct = Self::default();
11396 __struct.target_network = buf.get_u8();
11397 __struct.target_system = buf.get_u8();
11398 __struct.target_component = buf.get_u8();
11399 for v in &mut __struct.payload {
11400 let val = buf.get_u8();
11401 *v = val;
11402 }
11403 Ok(__struct)
11404 }
11405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11406 let mut __tmp = BytesMut::new(bytes);
11407 #[allow(clippy::absurd_extreme_comparisons)]
11408 #[allow(unused_comparisons)]
11409 if __tmp.remaining() < Self::ENCODED_LEN {
11410 panic!(
11411 "buffer is too small (need {} bytes, but got {})",
11412 Self::ENCODED_LEN,
11413 __tmp.remaining(),
11414 )
11415 }
11416 __tmp.put_u8(self.target_network);
11417 __tmp.put_u8(self.target_system);
11418 __tmp.put_u8(self.target_component);
11419 for val in &self.payload {
11420 __tmp.put_u8(*val);
11421 }
11422 if matches!(version, MavlinkVersion::V2) {
11423 let len = __tmp.len();
11424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11425 } else {
11426 __tmp.len()
11427 }
11428 }
11429}
11430#[doc = "id: 264"]
11431#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11432#[derive(Debug, Clone, PartialEq)]
11433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11435pub struct FLIGHT_INFORMATION_DATA {
11436 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11437 pub arming_time_utc: u64,
11438 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11439 pub takeoff_time_utc: u64,
11440 #[doc = "Flight number. Note, field is misnamed UUID."]
11441 pub flight_uuid: u64,
11442 #[doc = "Timestamp (time since system boot)."]
11443 pub time_boot_ms: u32,
11444 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11445 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11446 pub landing_time: u32,
11447}
11448impl FLIGHT_INFORMATION_DATA {
11449 pub const ENCODED_LEN: usize = 32usize;
11450 pub const DEFAULT: Self = Self {
11451 arming_time_utc: 0_u64,
11452 takeoff_time_utc: 0_u64,
11453 flight_uuid: 0_u64,
11454 time_boot_ms: 0_u32,
11455 landing_time: 0_u32,
11456 };
11457 #[cfg(feature = "arbitrary")]
11458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11459 use arbitrary::{Arbitrary, Unstructured};
11460 let mut buf = [0u8; 1024];
11461 rng.fill_bytes(&mut buf);
11462 let mut unstructured = Unstructured::new(&buf);
11463 Self::arbitrary(&mut unstructured).unwrap_or_default()
11464 }
11465}
11466impl Default for FLIGHT_INFORMATION_DATA {
11467 fn default() -> Self {
11468 Self::DEFAULT.clone()
11469 }
11470}
11471impl MessageData for FLIGHT_INFORMATION_DATA {
11472 type Message = MavMessage;
11473 const ID: u32 = 264u32;
11474 const NAME: &'static str = "FLIGHT_INFORMATION";
11475 const EXTRA_CRC: u8 = 49u8;
11476 const ENCODED_LEN: usize = 32usize;
11477 fn deser(
11478 _version: MavlinkVersion,
11479 __input: &[u8],
11480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11481 let avail_len = __input.len();
11482 let mut payload_buf = [0; Self::ENCODED_LEN];
11483 let mut buf = if avail_len < Self::ENCODED_LEN {
11484 payload_buf[0..avail_len].copy_from_slice(__input);
11485 Bytes::new(&payload_buf)
11486 } else {
11487 Bytes::new(__input)
11488 };
11489 let mut __struct = Self::default();
11490 __struct.arming_time_utc = buf.get_u64_le();
11491 __struct.takeoff_time_utc = buf.get_u64_le();
11492 __struct.flight_uuid = buf.get_u64_le();
11493 __struct.time_boot_ms = buf.get_u32_le();
11494 __struct.landing_time = buf.get_u32_le();
11495 Ok(__struct)
11496 }
11497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11498 let mut __tmp = BytesMut::new(bytes);
11499 #[allow(clippy::absurd_extreme_comparisons)]
11500 #[allow(unused_comparisons)]
11501 if __tmp.remaining() < Self::ENCODED_LEN {
11502 panic!(
11503 "buffer is too small (need {} bytes, but got {})",
11504 Self::ENCODED_LEN,
11505 __tmp.remaining(),
11506 )
11507 }
11508 __tmp.put_u64_le(self.arming_time_utc);
11509 __tmp.put_u64_le(self.takeoff_time_utc);
11510 __tmp.put_u64_le(self.flight_uuid);
11511 __tmp.put_u32_le(self.time_boot_ms);
11512 __tmp.put_u32_le(self.landing_time);
11513 if matches!(version, MavlinkVersion::V2) {
11514 let len = __tmp.len();
11515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11516 } else {
11517 __tmp.len()
11518 }
11519 }
11520}
11521#[doc = "id: 144"]
11522#[doc = "Current motion information from a designated system."]
11523#[derive(Debug, Clone, PartialEq)]
11524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11526pub struct FOLLOW_TARGET_DATA {
11527 #[doc = "Timestamp (time since system boot)."]
11528 pub timestamp: u64,
11529 #[doc = "button states or switches of a tracker device"]
11530 pub custom_state: u64,
11531 #[doc = "Latitude (WGS84)"]
11532 pub lat: i32,
11533 #[doc = "Longitude (WGS84)"]
11534 pub lon: i32,
11535 #[doc = "Altitude (MSL)"]
11536 pub alt: f32,
11537 #[doc = "target velocity (0,0,0) for unknown"]
11538 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11539 pub vel: [f32; 3],
11540 #[doc = "linear target acceleration (0,0,0) for unknown"]
11541 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11542 pub acc: [f32; 3],
11543 #[doc = "(0 0 0 0 for unknown)"]
11544 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11545 pub attitude_q: [f32; 4],
11546 #[doc = "(0 0 0 for unknown)"]
11547 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11548 pub rates: [f32; 3],
11549 #[doc = "eph epv"]
11550 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11551 pub position_cov: [f32; 3],
11552 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11553 pub est_capabilities: u8,
11554}
11555impl FOLLOW_TARGET_DATA {
11556 pub const ENCODED_LEN: usize = 93usize;
11557 pub const DEFAULT: Self = Self {
11558 timestamp: 0_u64,
11559 custom_state: 0_u64,
11560 lat: 0_i32,
11561 lon: 0_i32,
11562 alt: 0.0_f32,
11563 vel: [0.0_f32; 3usize],
11564 acc: [0.0_f32; 3usize],
11565 attitude_q: [0.0_f32; 4usize],
11566 rates: [0.0_f32; 3usize],
11567 position_cov: [0.0_f32; 3usize],
11568 est_capabilities: 0_u8,
11569 };
11570 #[cfg(feature = "arbitrary")]
11571 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11572 use arbitrary::{Arbitrary, Unstructured};
11573 let mut buf = [0u8; 1024];
11574 rng.fill_bytes(&mut buf);
11575 let mut unstructured = Unstructured::new(&buf);
11576 Self::arbitrary(&mut unstructured).unwrap_or_default()
11577 }
11578}
11579impl Default for FOLLOW_TARGET_DATA {
11580 fn default() -> Self {
11581 Self::DEFAULT.clone()
11582 }
11583}
11584impl MessageData for FOLLOW_TARGET_DATA {
11585 type Message = MavMessage;
11586 const ID: u32 = 144u32;
11587 const NAME: &'static str = "FOLLOW_TARGET";
11588 const EXTRA_CRC: u8 = 127u8;
11589 const ENCODED_LEN: usize = 93usize;
11590 fn deser(
11591 _version: MavlinkVersion,
11592 __input: &[u8],
11593 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11594 let avail_len = __input.len();
11595 let mut payload_buf = [0; Self::ENCODED_LEN];
11596 let mut buf = if avail_len < Self::ENCODED_LEN {
11597 payload_buf[0..avail_len].copy_from_slice(__input);
11598 Bytes::new(&payload_buf)
11599 } else {
11600 Bytes::new(__input)
11601 };
11602 let mut __struct = Self::default();
11603 __struct.timestamp = buf.get_u64_le();
11604 __struct.custom_state = buf.get_u64_le();
11605 __struct.lat = buf.get_i32_le();
11606 __struct.lon = buf.get_i32_le();
11607 __struct.alt = buf.get_f32_le();
11608 for v in &mut __struct.vel {
11609 let val = buf.get_f32_le();
11610 *v = val;
11611 }
11612 for v in &mut __struct.acc {
11613 let val = buf.get_f32_le();
11614 *v = val;
11615 }
11616 for v in &mut __struct.attitude_q {
11617 let val = buf.get_f32_le();
11618 *v = val;
11619 }
11620 for v in &mut __struct.rates {
11621 let val = buf.get_f32_le();
11622 *v = val;
11623 }
11624 for v in &mut __struct.position_cov {
11625 let val = buf.get_f32_le();
11626 *v = val;
11627 }
11628 __struct.est_capabilities = buf.get_u8();
11629 Ok(__struct)
11630 }
11631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11632 let mut __tmp = BytesMut::new(bytes);
11633 #[allow(clippy::absurd_extreme_comparisons)]
11634 #[allow(unused_comparisons)]
11635 if __tmp.remaining() < Self::ENCODED_LEN {
11636 panic!(
11637 "buffer is too small (need {} bytes, but got {})",
11638 Self::ENCODED_LEN,
11639 __tmp.remaining(),
11640 )
11641 }
11642 __tmp.put_u64_le(self.timestamp);
11643 __tmp.put_u64_le(self.custom_state);
11644 __tmp.put_i32_le(self.lat);
11645 __tmp.put_i32_le(self.lon);
11646 __tmp.put_f32_le(self.alt);
11647 for val in &self.vel {
11648 __tmp.put_f32_le(*val);
11649 }
11650 for val in &self.acc {
11651 __tmp.put_f32_le(*val);
11652 }
11653 for val in &self.attitude_q {
11654 __tmp.put_f32_le(*val);
11655 }
11656 for val in &self.rates {
11657 __tmp.put_f32_le(*val);
11658 }
11659 for val in &self.position_cov {
11660 __tmp.put_f32_le(*val);
11661 }
11662 __tmp.put_u8(self.est_capabilities);
11663 if matches!(version, MavlinkVersion::V2) {
11664 let len = __tmp.len();
11665 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11666 } else {
11667 __tmp.len()
11668 }
11669 }
11670}
11671#[doc = "id: 371"]
11672#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11673#[derive(Debug, Clone, PartialEq)]
11674#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11675#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11676pub struct FUEL_STATUS_DATA {
11677 #[doc = "Capacity when full. Must be provided."]
11678 pub maximum_fuel: f32,
11679 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11680 pub consumed_fuel: f32,
11681 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11682 pub remaining_fuel: f32,
11683 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
11684 pub flow_rate: f32,
11685 #[doc = "Fuel temperature. NaN: field not provided."]
11686 pub temperature: f32,
11687 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
11688 pub fuel_type: MavFuelType,
11689 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
11690 pub id: u8,
11691 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
11692 pub percent_remaining: u8,
11693}
11694impl FUEL_STATUS_DATA {
11695 pub const ENCODED_LEN: usize = 26usize;
11696 pub const DEFAULT: Self = Self {
11697 maximum_fuel: 0.0_f32,
11698 consumed_fuel: 0.0_f32,
11699 remaining_fuel: 0.0_f32,
11700 flow_rate: 0.0_f32,
11701 temperature: 0.0_f32,
11702 fuel_type: MavFuelType::DEFAULT,
11703 id: 0_u8,
11704 percent_remaining: 0_u8,
11705 };
11706 #[cfg(feature = "arbitrary")]
11707 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11708 use arbitrary::{Arbitrary, Unstructured};
11709 let mut buf = [0u8; 1024];
11710 rng.fill_bytes(&mut buf);
11711 let mut unstructured = Unstructured::new(&buf);
11712 Self::arbitrary(&mut unstructured).unwrap_or_default()
11713 }
11714}
11715impl Default for FUEL_STATUS_DATA {
11716 fn default() -> Self {
11717 Self::DEFAULT.clone()
11718 }
11719}
11720impl MessageData for FUEL_STATUS_DATA {
11721 type Message = MavMessage;
11722 const ID: u32 = 371u32;
11723 const NAME: &'static str = "FUEL_STATUS";
11724 const EXTRA_CRC: u8 = 10u8;
11725 const ENCODED_LEN: usize = 26usize;
11726 fn deser(
11727 _version: MavlinkVersion,
11728 __input: &[u8],
11729 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11730 let avail_len = __input.len();
11731 let mut payload_buf = [0; Self::ENCODED_LEN];
11732 let mut buf = if avail_len < Self::ENCODED_LEN {
11733 payload_buf[0..avail_len].copy_from_slice(__input);
11734 Bytes::new(&payload_buf)
11735 } else {
11736 Bytes::new(__input)
11737 };
11738 let mut __struct = Self::default();
11739 __struct.maximum_fuel = buf.get_f32_le();
11740 __struct.consumed_fuel = buf.get_f32_le();
11741 __struct.remaining_fuel = buf.get_f32_le();
11742 __struct.flow_rate = buf.get_f32_le();
11743 __struct.temperature = buf.get_f32_le();
11744 let tmp = buf.get_u32_le();
11745 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
11746 ::mavlink_core::error::ParserError::InvalidEnum {
11747 enum_type: "MavFuelType",
11748 value: tmp as u32,
11749 },
11750 )?;
11751 __struct.id = buf.get_u8();
11752 __struct.percent_remaining = buf.get_u8();
11753 Ok(__struct)
11754 }
11755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11756 let mut __tmp = BytesMut::new(bytes);
11757 #[allow(clippy::absurd_extreme_comparisons)]
11758 #[allow(unused_comparisons)]
11759 if __tmp.remaining() < Self::ENCODED_LEN {
11760 panic!(
11761 "buffer is too small (need {} bytes, but got {})",
11762 Self::ENCODED_LEN,
11763 __tmp.remaining(),
11764 )
11765 }
11766 __tmp.put_f32_le(self.maximum_fuel);
11767 __tmp.put_f32_le(self.consumed_fuel);
11768 __tmp.put_f32_le(self.remaining_fuel);
11769 __tmp.put_f32_le(self.flow_rate);
11770 __tmp.put_f32_le(self.temperature);
11771 __tmp.put_u32_le(self.fuel_type as u32);
11772 __tmp.put_u8(self.id);
11773 __tmp.put_u8(self.percent_remaining);
11774 if matches!(version, MavlinkVersion::V2) {
11775 let len = __tmp.len();
11776 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11777 } else {
11778 __tmp.len()
11779 }
11780 }
11781}
11782#[doc = "id: 373"]
11783#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
11784#[derive(Debug, Clone, PartialEq)]
11785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11787pub struct GENERATOR_STATUS_DATA {
11788 #[doc = "Status flags."]
11789 pub status: MavGeneratorStatusFlag,
11790 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
11791 pub battery_current: f32,
11792 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
11793 pub load_current: f32,
11794 #[doc = "The power being generated. NaN: field not provided"]
11795 pub power_generated: f32,
11796 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
11797 pub bus_voltage: f32,
11798 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
11799 pub bat_current_setpoint: f32,
11800 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
11801 pub runtime: u32,
11802 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
11803 pub time_until_maintenance: i32,
11804 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
11805 pub generator_speed: u16,
11806 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
11807 pub rectifier_temperature: i16,
11808 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
11809 pub generator_temperature: i16,
11810}
11811impl GENERATOR_STATUS_DATA {
11812 pub const ENCODED_LEN: usize = 42usize;
11813 pub const DEFAULT: Self = Self {
11814 status: MavGeneratorStatusFlag::DEFAULT,
11815 battery_current: 0.0_f32,
11816 load_current: 0.0_f32,
11817 power_generated: 0.0_f32,
11818 bus_voltage: 0.0_f32,
11819 bat_current_setpoint: 0.0_f32,
11820 runtime: 0_u32,
11821 time_until_maintenance: 0_i32,
11822 generator_speed: 0_u16,
11823 rectifier_temperature: 0_i16,
11824 generator_temperature: 0_i16,
11825 };
11826 #[cfg(feature = "arbitrary")]
11827 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11828 use arbitrary::{Arbitrary, Unstructured};
11829 let mut buf = [0u8; 1024];
11830 rng.fill_bytes(&mut buf);
11831 let mut unstructured = Unstructured::new(&buf);
11832 Self::arbitrary(&mut unstructured).unwrap_or_default()
11833 }
11834}
11835impl Default for GENERATOR_STATUS_DATA {
11836 fn default() -> Self {
11837 Self::DEFAULT.clone()
11838 }
11839}
11840impl MessageData for GENERATOR_STATUS_DATA {
11841 type Message = MavMessage;
11842 const ID: u32 = 373u32;
11843 const NAME: &'static str = "GENERATOR_STATUS";
11844 const EXTRA_CRC: u8 = 117u8;
11845 const ENCODED_LEN: usize = 42usize;
11846 fn deser(
11847 _version: MavlinkVersion,
11848 __input: &[u8],
11849 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11850 let avail_len = __input.len();
11851 let mut payload_buf = [0; Self::ENCODED_LEN];
11852 let mut buf = if avail_len < Self::ENCODED_LEN {
11853 payload_buf[0..avail_len].copy_from_slice(__input);
11854 Bytes::new(&payload_buf)
11855 } else {
11856 Bytes::new(__input)
11857 };
11858 let mut __struct = Self::default();
11859 let tmp = buf.get_u64_le();
11860 __struct.status = MavGeneratorStatusFlag::from_bits(
11861 tmp & MavGeneratorStatusFlag::all().bits(),
11862 )
11863 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11864 flag_type: "MavGeneratorStatusFlag",
11865 value: tmp as u32,
11866 })?;
11867 __struct.battery_current = buf.get_f32_le();
11868 __struct.load_current = buf.get_f32_le();
11869 __struct.power_generated = buf.get_f32_le();
11870 __struct.bus_voltage = buf.get_f32_le();
11871 __struct.bat_current_setpoint = buf.get_f32_le();
11872 __struct.runtime = buf.get_u32_le();
11873 __struct.time_until_maintenance = buf.get_i32_le();
11874 __struct.generator_speed = buf.get_u16_le();
11875 __struct.rectifier_temperature = buf.get_i16_le();
11876 __struct.generator_temperature = buf.get_i16_le();
11877 Ok(__struct)
11878 }
11879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11880 let mut __tmp = BytesMut::new(bytes);
11881 #[allow(clippy::absurd_extreme_comparisons)]
11882 #[allow(unused_comparisons)]
11883 if __tmp.remaining() < Self::ENCODED_LEN {
11884 panic!(
11885 "buffer is too small (need {} bytes, but got {})",
11886 Self::ENCODED_LEN,
11887 __tmp.remaining(),
11888 )
11889 }
11890 __tmp.put_u64_le(self.status.bits());
11891 __tmp.put_f32_le(self.battery_current);
11892 __tmp.put_f32_le(self.load_current);
11893 __tmp.put_f32_le(self.power_generated);
11894 __tmp.put_f32_le(self.bus_voltage);
11895 __tmp.put_f32_le(self.bat_current_setpoint);
11896 __tmp.put_u32_le(self.runtime);
11897 __tmp.put_i32_le(self.time_until_maintenance);
11898 __tmp.put_u16_le(self.generator_speed);
11899 __tmp.put_i16_le(self.rectifier_temperature);
11900 __tmp.put_i16_le(self.generator_temperature);
11901 if matches!(version, MavlinkVersion::V2) {
11902 let len = __tmp.len();
11903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11904 } else {
11905 __tmp.len()
11906 }
11907 }
11908}
11909#[doc = "id: 285"]
11910#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
11911#[derive(Debug, Clone, PartialEq)]
11912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11914pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11915 #[doc = "Timestamp (time since system boot)."]
11916 pub time_boot_ms: u32,
11917 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
11918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11919 pub q: [f32; 4],
11920 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
11921 pub angular_velocity_x: f32,
11922 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
11923 pub angular_velocity_y: f32,
11924 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
11925 pub angular_velocity_z: f32,
11926 #[doc = "Failure flags (0 for no failure)"]
11927 pub failure_flags: GimbalDeviceErrorFlags,
11928 #[doc = "Current gimbal flags set."]
11929 pub flags: GimbalDeviceFlags,
11930 #[doc = "System ID"]
11931 pub target_system: u8,
11932 #[doc = "Component ID"]
11933 pub target_component: u8,
11934 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
11935 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11936 pub delta_yaw: f32,
11937 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
11938 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11939 pub delta_yaw_velocity: f32,
11940 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11941 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11942 pub gimbal_device_id: u8,
11943}
11944impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11945 pub const ENCODED_LEN: usize = 49usize;
11946 pub const DEFAULT: Self = Self {
11947 time_boot_ms: 0_u32,
11948 q: [0.0_f32; 4usize],
11949 angular_velocity_x: 0.0_f32,
11950 angular_velocity_y: 0.0_f32,
11951 angular_velocity_z: 0.0_f32,
11952 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
11953 flags: GimbalDeviceFlags::DEFAULT,
11954 target_system: 0_u8,
11955 target_component: 0_u8,
11956 delta_yaw: 0.0_f32,
11957 delta_yaw_velocity: 0.0_f32,
11958 gimbal_device_id: 0_u8,
11959 };
11960 #[cfg(feature = "arbitrary")]
11961 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11962 use arbitrary::{Arbitrary, Unstructured};
11963 let mut buf = [0u8; 1024];
11964 rng.fill_bytes(&mut buf);
11965 let mut unstructured = Unstructured::new(&buf);
11966 Self::arbitrary(&mut unstructured).unwrap_or_default()
11967 }
11968}
11969impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11970 fn default() -> Self {
11971 Self::DEFAULT.clone()
11972 }
11973}
11974impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11975 type Message = MavMessage;
11976 const ID: u32 = 285u32;
11977 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
11978 const EXTRA_CRC: u8 = 137u8;
11979 const ENCODED_LEN: usize = 49usize;
11980 fn deser(
11981 _version: MavlinkVersion,
11982 __input: &[u8],
11983 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11984 let avail_len = __input.len();
11985 let mut payload_buf = [0; Self::ENCODED_LEN];
11986 let mut buf = if avail_len < Self::ENCODED_LEN {
11987 payload_buf[0..avail_len].copy_from_slice(__input);
11988 Bytes::new(&payload_buf)
11989 } else {
11990 Bytes::new(__input)
11991 };
11992 let mut __struct = Self::default();
11993 __struct.time_boot_ms = buf.get_u32_le();
11994 for v in &mut __struct.q {
11995 let val = buf.get_f32_le();
11996 *v = val;
11997 }
11998 __struct.angular_velocity_x = buf.get_f32_le();
11999 __struct.angular_velocity_y = buf.get_f32_le();
12000 __struct.angular_velocity_z = buf.get_f32_le();
12001 let tmp = buf.get_u32_le();
12002 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12003 tmp & GimbalDeviceErrorFlags::all().bits(),
12004 )
12005 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12006 flag_type: "GimbalDeviceErrorFlags",
12007 value: tmp as u32,
12008 })?;
12009 let tmp = buf.get_u16_le();
12010 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12011 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12012 flag_type: "GimbalDeviceFlags",
12013 value: tmp as u32,
12014 })?;
12015 __struct.target_system = buf.get_u8();
12016 __struct.target_component = buf.get_u8();
12017 __struct.delta_yaw = buf.get_f32_le();
12018 __struct.delta_yaw_velocity = buf.get_f32_le();
12019 __struct.gimbal_device_id = buf.get_u8();
12020 Ok(__struct)
12021 }
12022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12023 let mut __tmp = BytesMut::new(bytes);
12024 #[allow(clippy::absurd_extreme_comparisons)]
12025 #[allow(unused_comparisons)]
12026 if __tmp.remaining() < Self::ENCODED_LEN {
12027 panic!(
12028 "buffer is too small (need {} bytes, but got {})",
12029 Self::ENCODED_LEN,
12030 __tmp.remaining(),
12031 )
12032 }
12033 __tmp.put_u32_le(self.time_boot_ms);
12034 for val in &self.q {
12035 __tmp.put_f32_le(*val);
12036 }
12037 __tmp.put_f32_le(self.angular_velocity_x);
12038 __tmp.put_f32_le(self.angular_velocity_y);
12039 __tmp.put_f32_le(self.angular_velocity_z);
12040 __tmp.put_u32_le(self.failure_flags.bits());
12041 __tmp.put_u16_le(self.flags.bits());
12042 __tmp.put_u8(self.target_system);
12043 __tmp.put_u8(self.target_component);
12044 __tmp.put_f32_le(self.delta_yaw);
12045 __tmp.put_f32_le(self.delta_yaw_velocity);
12046 __tmp.put_u8(self.gimbal_device_id);
12047 if matches!(version, MavlinkVersion::V2) {
12048 let len = __tmp.len();
12049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12050 } else {
12051 __tmp.len()
12052 }
12053 }
12054}
12055#[doc = "id: 283"]
12056#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12057#[derive(Debug, Clone, PartialEq)]
12058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12060pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12061 #[doc = "UID of gimbal hardware (0 if unknown)."]
12062 pub uid: u64,
12063 #[doc = "Timestamp (time since system boot)."]
12064 pub time_boot_ms: u32,
12065 #[doc = "0xff)."]
12066 pub firmware_version: u32,
12067 #[doc = "0xff)."]
12068 pub hardware_version: u32,
12069 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12070 pub roll_min: f32,
12071 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12072 pub roll_max: f32,
12073 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12074 pub pitch_min: f32,
12075 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12076 pub pitch_max: f32,
12077 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12078 pub yaw_min: f32,
12079 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12080 pub yaw_max: f32,
12081 #[doc = "Bitmap of gimbal capability flags."]
12082 pub cap_flags: GimbalDeviceCapFlags,
12083 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12084 pub custom_cap_flags: u16,
12085 #[doc = "Name of the gimbal vendor."]
12086 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12087 pub vendor_name: [u8; 32],
12088 #[doc = "Name of the gimbal model."]
12089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12090 pub model_name: [u8; 32],
12091 #[doc = "Custom name of the gimbal given to it by the user."]
12092 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12093 pub custom_name: [u8; 32],
12094 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12095 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12096 pub gimbal_device_id: u8,
12097}
12098impl GIMBAL_DEVICE_INFORMATION_DATA {
12099 pub const ENCODED_LEN: usize = 145usize;
12100 pub const DEFAULT: Self = Self {
12101 uid: 0_u64,
12102 time_boot_ms: 0_u32,
12103 firmware_version: 0_u32,
12104 hardware_version: 0_u32,
12105 roll_min: 0.0_f32,
12106 roll_max: 0.0_f32,
12107 pitch_min: 0.0_f32,
12108 pitch_max: 0.0_f32,
12109 yaw_min: 0.0_f32,
12110 yaw_max: 0.0_f32,
12111 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12112 custom_cap_flags: 0_u16,
12113 vendor_name: [0_u8; 32usize],
12114 model_name: [0_u8; 32usize],
12115 custom_name: [0_u8; 32usize],
12116 gimbal_device_id: 0_u8,
12117 };
12118 #[cfg(feature = "arbitrary")]
12119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12120 use arbitrary::{Arbitrary, Unstructured};
12121 let mut buf = [0u8; 1024];
12122 rng.fill_bytes(&mut buf);
12123 let mut unstructured = Unstructured::new(&buf);
12124 Self::arbitrary(&mut unstructured).unwrap_or_default()
12125 }
12126}
12127impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12128 fn default() -> Self {
12129 Self::DEFAULT.clone()
12130 }
12131}
12132impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12133 type Message = MavMessage;
12134 const ID: u32 = 283u32;
12135 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12136 const EXTRA_CRC: u8 = 74u8;
12137 const ENCODED_LEN: usize = 145usize;
12138 fn deser(
12139 _version: MavlinkVersion,
12140 __input: &[u8],
12141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12142 let avail_len = __input.len();
12143 let mut payload_buf = [0; Self::ENCODED_LEN];
12144 let mut buf = if avail_len < Self::ENCODED_LEN {
12145 payload_buf[0..avail_len].copy_from_slice(__input);
12146 Bytes::new(&payload_buf)
12147 } else {
12148 Bytes::new(__input)
12149 };
12150 let mut __struct = Self::default();
12151 __struct.uid = buf.get_u64_le();
12152 __struct.time_boot_ms = buf.get_u32_le();
12153 __struct.firmware_version = buf.get_u32_le();
12154 __struct.hardware_version = buf.get_u32_le();
12155 __struct.roll_min = buf.get_f32_le();
12156 __struct.roll_max = buf.get_f32_le();
12157 __struct.pitch_min = buf.get_f32_le();
12158 __struct.pitch_max = buf.get_f32_le();
12159 __struct.yaw_min = buf.get_f32_le();
12160 __struct.yaw_max = buf.get_f32_le();
12161 let tmp = buf.get_u16_le();
12162 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12163 tmp & GimbalDeviceCapFlags::all().bits(),
12164 )
12165 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12166 flag_type: "GimbalDeviceCapFlags",
12167 value: tmp as u32,
12168 })?;
12169 __struct.custom_cap_flags = buf.get_u16_le();
12170 for v in &mut __struct.vendor_name {
12171 let val = buf.get_u8();
12172 *v = val;
12173 }
12174 for v in &mut __struct.model_name {
12175 let val = buf.get_u8();
12176 *v = val;
12177 }
12178 for v in &mut __struct.custom_name {
12179 let val = buf.get_u8();
12180 *v = val;
12181 }
12182 __struct.gimbal_device_id = buf.get_u8();
12183 Ok(__struct)
12184 }
12185 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12186 let mut __tmp = BytesMut::new(bytes);
12187 #[allow(clippy::absurd_extreme_comparisons)]
12188 #[allow(unused_comparisons)]
12189 if __tmp.remaining() < Self::ENCODED_LEN {
12190 panic!(
12191 "buffer is too small (need {} bytes, but got {})",
12192 Self::ENCODED_LEN,
12193 __tmp.remaining(),
12194 )
12195 }
12196 __tmp.put_u64_le(self.uid);
12197 __tmp.put_u32_le(self.time_boot_ms);
12198 __tmp.put_u32_le(self.firmware_version);
12199 __tmp.put_u32_le(self.hardware_version);
12200 __tmp.put_f32_le(self.roll_min);
12201 __tmp.put_f32_le(self.roll_max);
12202 __tmp.put_f32_le(self.pitch_min);
12203 __tmp.put_f32_le(self.pitch_max);
12204 __tmp.put_f32_le(self.yaw_min);
12205 __tmp.put_f32_le(self.yaw_max);
12206 __tmp.put_u16_le(self.cap_flags.bits());
12207 __tmp.put_u16_le(self.custom_cap_flags);
12208 for val in &self.vendor_name {
12209 __tmp.put_u8(*val);
12210 }
12211 for val in &self.model_name {
12212 __tmp.put_u8(*val);
12213 }
12214 for val in &self.custom_name {
12215 __tmp.put_u8(*val);
12216 }
12217 __tmp.put_u8(self.gimbal_device_id);
12218 if matches!(version, MavlinkVersion::V2) {
12219 let len = __tmp.len();
12220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12221 } else {
12222 __tmp.len()
12223 }
12224 }
12225}
12226#[doc = "id: 284"]
12227#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12228#[derive(Debug, Clone, PartialEq)]
12229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12231pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12232 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12233 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12234 pub q: [f32; 4],
12235 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12236 pub angular_velocity_x: f32,
12237 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12238 pub angular_velocity_y: f32,
12239 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12240 pub angular_velocity_z: f32,
12241 #[doc = "Low level gimbal flags."]
12242 pub flags: GimbalDeviceFlags,
12243 #[doc = "System ID"]
12244 pub target_system: u8,
12245 #[doc = "Component ID"]
12246 pub target_component: u8,
12247}
12248impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12249 pub const ENCODED_LEN: usize = 32usize;
12250 pub const DEFAULT: Self = Self {
12251 q: [0.0_f32; 4usize],
12252 angular_velocity_x: 0.0_f32,
12253 angular_velocity_y: 0.0_f32,
12254 angular_velocity_z: 0.0_f32,
12255 flags: GimbalDeviceFlags::DEFAULT,
12256 target_system: 0_u8,
12257 target_component: 0_u8,
12258 };
12259 #[cfg(feature = "arbitrary")]
12260 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12261 use arbitrary::{Arbitrary, Unstructured};
12262 let mut buf = [0u8; 1024];
12263 rng.fill_bytes(&mut buf);
12264 let mut unstructured = Unstructured::new(&buf);
12265 Self::arbitrary(&mut unstructured).unwrap_or_default()
12266 }
12267}
12268impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12269 fn default() -> Self {
12270 Self::DEFAULT.clone()
12271 }
12272}
12273impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12274 type Message = MavMessage;
12275 const ID: u32 = 284u32;
12276 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12277 const EXTRA_CRC: u8 = 99u8;
12278 const ENCODED_LEN: usize = 32usize;
12279 fn deser(
12280 _version: MavlinkVersion,
12281 __input: &[u8],
12282 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12283 let avail_len = __input.len();
12284 let mut payload_buf = [0; Self::ENCODED_LEN];
12285 let mut buf = if avail_len < Self::ENCODED_LEN {
12286 payload_buf[0..avail_len].copy_from_slice(__input);
12287 Bytes::new(&payload_buf)
12288 } else {
12289 Bytes::new(__input)
12290 };
12291 let mut __struct = Self::default();
12292 for v in &mut __struct.q {
12293 let val = buf.get_f32_le();
12294 *v = val;
12295 }
12296 __struct.angular_velocity_x = buf.get_f32_le();
12297 __struct.angular_velocity_y = buf.get_f32_le();
12298 __struct.angular_velocity_z = buf.get_f32_le();
12299 let tmp = buf.get_u16_le();
12300 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12301 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12302 flag_type: "GimbalDeviceFlags",
12303 value: tmp as u32,
12304 })?;
12305 __struct.target_system = buf.get_u8();
12306 __struct.target_component = buf.get_u8();
12307 Ok(__struct)
12308 }
12309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12310 let mut __tmp = BytesMut::new(bytes);
12311 #[allow(clippy::absurd_extreme_comparisons)]
12312 #[allow(unused_comparisons)]
12313 if __tmp.remaining() < Self::ENCODED_LEN {
12314 panic!(
12315 "buffer is too small (need {} bytes, but got {})",
12316 Self::ENCODED_LEN,
12317 __tmp.remaining(),
12318 )
12319 }
12320 for val in &self.q {
12321 __tmp.put_f32_le(*val);
12322 }
12323 __tmp.put_f32_le(self.angular_velocity_x);
12324 __tmp.put_f32_le(self.angular_velocity_y);
12325 __tmp.put_f32_le(self.angular_velocity_z);
12326 __tmp.put_u16_le(self.flags.bits());
12327 __tmp.put_u8(self.target_system);
12328 __tmp.put_u8(self.target_component);
12329 if matches!(version, MavlinkVersion::V2) {
12330 let len = __tmp.len();
12331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12332 } else {
12333 __tmp.len()
12334 }
12335 }
12336}
12337#[doc = "id: 280"]
12338#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12339#[derive(Debug, Clone, PartialEq)]
12340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12342pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12343 #[doc = "Timestamp (time since system boot)."]
12344 pub time_boot_ms: u32,
12345 #[doc = "Bitmap of gimbal capability flags."]
12346 pub cap_flags: GimbalManagerCapFlags,
12347 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12348 pub roll_min: f32,
12349 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12350 pub roll_max: f32,
12351 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12352 pub pitch_min: f32,
12353 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12354 pub pitch_max: f32,
12355 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12356 pub yaw_min: f32,
12357 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12358 pub yaw_max: f32,
12359 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12360 pub gimbal_device_id: u8,
12361}
12362impl GIMBAL_MANAGER_INFORMATION_DATA {
12363 pub const ENCODED_LEN: usize = 33usize;
12364 pub const DEFAULT: Self = Self {
12365 time_boot_ms: 0_u32,
12366 cap_flags: GimbalManagerCapFlags::DEFAULT,
12367 roll_min: 0.0_f32,
12368 roll_max: 0.0_f32,
12369 pitch_min: 0.0_f32,
12370 pitch_max: 0.0_f32,
12371 yaw_min: 0.0_f32,
12372 yaw_max: 0.0_f32,
12373 gimbal_device_id: 0_u8,
12374 };
12375 #[cfg(feature = "arbitrary")]
12376 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12377 use arbitrary::{Arbitrary, Unstructured};
12378 let mut buf = [0u8; 1024];
12379 rng.fill_bytes(&mut buf);
12380 let mut unstructured = Unstructured::new(&buf);
12381 Self::arbitrary(&mut unstructured).unwrap_or_default()
12382 }
12383}
12384impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12385 fn default() -> Self {
12386 Self::DEFAULT.clone()
12387 }
12388}
12389impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12390 type Message = MavMessage;
12391 const ID: u32 = 280u32;
12392 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12393 const EXTRA_CRC: u8 = 70u8;
12394 const ENCODED_LEN: usize = 33usize;
12395 fn deser(
12396 _version: MavlinkVersion,
12397 __input: &[u8],
12398 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12399 let avail_len = __input.len();
12400 let mut payload_buf = [0; Self::ENCODED_LEN];
12401 let mut buf = if avail_len < Self::ENCODED_LEN {
12402 payload_buf[0..avail_len].copy_from_slice(__input);
12403 Bytes::new(&payload_buf)
12404 } else {
12405 Bytes::new(__input)
12406 };
12407 let mut __struct = Self::default();
12408 __struct.time_boot_ms = buf.get_u32_le();
12409 let tmp = buf.get_u32_le();
12410 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12411 tmp & GimbalManagerCapFlags::all().bits(),
12412 )
12413 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12414 flag_type: "GimbalManagerCapFlags",
12415 value: tmp as u32,
12416 })?;
12417 __struct.roll_min = buf.get_f32_le();
12418 __struct.roll_max = buf.get_f32_le();
12419 __struct.pitch_min = buf.get_f32_le();
12420 __struct.pitch_max = buf.get_f32_le();
12421 __struct.yaw_min = buf.get_f32_le();
12422 __struct.yaw_max = buf.get_f32_le();
12423 __struct.gimbal_device_id = buf.get_u8();
12424 Ok(__struct)
12425 }
12426 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12427 let mut __tmp = BytesMut::new(bytes);
12428 #[allow(clippy::absurd_extreme_comparisons)]
12429 #[allow(unused_comparisons)]
12430 if __tmp.remaining() < Self::ENCODED_LEN {
12431 panic!(
12432 "buffer is too small (need {} bytes, but got {})",
12433 Self::ENCODED_LEN,
12434 __tmp.remaining(),
12435 )
12436 }
12437 __tmp.put_u32_le(self.time_boot_ms);
12438 __tmp.put_u32_le(self.cap_flags.bits());
12439 __tmp.put_f32_le(self.roll_min);
12440 __tmp.put_f32_le(self.roll_max);
12441 __tmp.put_f32_le(self.pitch_min);
12442 __tmp.put_f32_le(self.pitch_max);
12443 __tmp.put_f32_le(self.yaw_min);
12444 __tmp.put_f32_le(self.yaw_max);
12445 __tmp.put_u8(self.gimbal_device_id);
12446 if matches!(version, MavlinkVersion::V2) {
12447 let len = __tmp.len();
12448 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12449 } else {
12450 __tmp.len()
12451 }
12452 }
12453}
12454#[doc = "id: 282"]
12455#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12456#[derive(Debug, Clone, PartialEq)]
12457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12459pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12460 #[doc = "High level gimbal manager flags to use."]
12461 pub flags: GimbalManagerFlags,
12462 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12463 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12464 pub q: [f32; 4],
12465 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12466 pub angular_velocity_x: f32,
12467 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12468 pub angular_velocity_y: f32,
12469 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12470 pub angular_velocity_z: f32,
12471 #[doc = "System ID"]
12472 pub target_system: u8,
12473 #[doc = "Component ID"]
12474 pub target_component: u8,
12475 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12476 pub gimbal_device_id: u8,
12477}
12478impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12479 pub const ENCODED_LEN: usize = 35usize;
12480 pub const DEFAULT: Self = Self {
12481 flags: GimbalManagerFlags::DEFAULT,
12482 q: [0.0_f32; 4usize],
12483 angular_velocity_x: 0.0_f32,
12484 angular_velocity_y: 0.0_f32,
12485 angular_velocity_z: 0.0_f32,
12486 target_system: 0_u8,
12487 target_component: 0_u8,
12488 gimbal_device_id: 0_u8,
12489 };
12490 #[cfg(feature = "arbitrary")]
12491 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12492 use arbitrary::{Arbitrary, Unstructured};
12493 let mut buf = [0u8; 1024];
12494 rng.fill_bytes(&mut buf);
12495 let mut unstructured = Unstructured::new(&buf);
12496 Self::arbitrary(&mut unstructured).unwrap_or_default()
12497 }
12498}
12499impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12500 fn default() -> Self {
12501 Self::DEFAULT.clone()
12502 }
12503}
12504impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12505 type Message = MavMessage;
12506 const ID: u32 = 282u32;
12507 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12508 const EXTRA_CRC: u8 = 123u8;
12509 const ENCODED_LEN: usize = 35usize;
12510 fn deser(
12511 _version: MavlinkVersion,
12512 __input: &[u8],
12513 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12514 let avail_len = __input.len();
12515 let mut payload_buf = [0; Self::ENCODED_LEN];
12516 let mut buf = if avail_len < Self::ENCODED_LEN {
12517 payload_buf[0..avail_len].copy_from_slice(__input);
12518 Bytes::new(&payload_buf)
12519 } else {
12520 Bytes::new(__input)
12521 };
12522 let mut __struct = Self::default();
12523 let tmp = buf.get_u32_le();
12524 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12525 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12526 flag_type: "GimbalManagerFlags",
12527 value: tmp as u32,
12528 })?;
12529 for v in &mut __struct.q {
12530 let val = buf.get_f32_le();
12531 *v = val;
12532 }
12533 __struct.angular_velocity_x = buf.get_f32_le();
12534 __struct.angular_velocity_y = buf.get_f32_le();
12535 __struct.angular_velocity_z = buf.get_f32_le();
12536 __struct.target_system = buf.get_u8();
12537 __struct.target_component = buf.get_u8();
12538 __struct.gimbal_device_id = buf.get_u8();
12539 Ok(__struct)
12540 }
12541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12542 let mut __tmp = BytesMut::new(bytes);
12543 #[allow(clippy::absurd_extreme_comparisons)]
12544 #[allow(unused_comparisons)]
12545 if __tmp.remaining() < Self::ENCODED_LEN {
12546 panic!(
12547 "buffer is too small (need {} bytes, but got {})",
12548 Self::ENCODED_LEN,
12549 __tmp.remaining(),
12550 )
12551 }
12552 __tmp.put_u32_le(self.flags.bits());
12553 for val in &self.q {
12554 __tmp.put_f32_le(*val);
12555 }
12556 __tmp.put_f32_le(self.angular_velocity_x);
12557 __tmp.put_f32_le(self.angular_velocity_y);
12558 __tmp.put_f32_le(self.angular_velocity_z);
12559 __tmp.put_u8(self.target_system);
12560 __tmp.put_u8(self.target_component);
12561 __tmp.put_u8(self.gimbal_device_id);
12562 if matches!(version, MavlinkVersion::V2) {
12563 let len = __tmp.len();
12564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12565 } else {
12566 __tmp.len()
12567 }
12568 }
12569}
12570#[doc = "id: 288"]
12571#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12572#[derive(Debug, Clone, PartialEq)]
12573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12574#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12575pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12576 #[doc = "High level gimbal manager flags."]
12577 pub flags: GimbalManagerFlags,
12578 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12579 pub pitch: f32,
12580 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12581 pub yaw: f32,
12582 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12583 pub pitch_rate: f32,
12584 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12585 pub yaw_rate: f32,
12586 #[doc = "System ID"]
12587 pub target_system: u8,
12588 #[doc = "Component ID"]
12589 pub target_component: u8,
12590 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12591 pub gimbal_device_id: u8,
12592}
12593impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12594 pub const ENCODED_LEN: usize = 23usize;
12595 pub const DEFAULT: Self = Self {
12596 flags: GimbalManagerFlags::DEFAULT,
12597 pitch: 0.0_f32,
12598 yaw: 0.0_f32,
12599 pitch_rate: 0.0_f32,
12600 yaw_rate: 0.0_f32,
12601 target_system: 0_u8,
12602 target_component: 0_u8,
12603 gimbal_device_id: 0_u8,
12604 };
12605 #[cfg(feature = "arbitrary")]
12606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12607 use arbitrary::{Arbitrary, Unstructured};
12608 let mut buf = [0u8; 1024];
12609 rng.fill_bytes(&mut buf);
12610 let mut unstructured = Unstructured::new(&buf);
12611 Self::arbitrary(&mut unstructured).unwrap_or_default()
12612 }
12613}
12614impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12615 fn default() -> Self {
12616 Self::DEFAULT.clone()
12617 }
12618}
12619impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12620 type Message = MavMessage;
12621 const ID: u32 = 288u32;
12622 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12623 const EXTRA_CRC: u8 = 20u8;
12624 const ENCODED_LEN: usize = 23usize;
12625 fn deser(
12626 _version: MavlinkVersion,
12627 __input: &[u8],
12628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12629 let avail_len = __input.len();
12630 let mut payload_buf = [0; Self::ENCODED_LEN];
12631 let mut buf = if avail_len < Self::ENCODED_LEN {
12632 payload_buf[0..avail_len].copy_from_slice(__input);
12633 Bytes::new(&payload_buf)
12634 } else {
12635 Bytes::new(__input)
12636 };
12637 let mut __struct = Self::default();
12638 let tmp = buf.get_u32_le();
12639 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12640 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12641 flag_type: "GimbalManagerFlags",
12642 value: tmp as u32,
12643 })?;
12644 __struct.pitch = buf.get_f32_le();
12645 __struct.yaw = buf.get_f32_le();
12646 __struct.pitch_rate = buf.get_f32_le();
12647 __struct.yaw_rate = buf.get_f32_le();
12648 __struct.target_system = buf.get_u8();
12649 __struct.target_component = buf.get_u8();
12650 __struct.gimbal_device_id = buf.get_u8();
12651 Ok(__struct)
12652 }
12653 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12654 let mut __tmp = BytesMut::new(bytes);
12655 #[allow(clippy::absurd_extreme_comparisons)]
12656 #[allow(unused_comparisons)]
12657 if __tmp.remaining() < Self::ENCODED_LEN {
12658 panic!(
12659 "buffer is too small (need {} bytes, but got {})",
12660 Self::ENCODED_LEN,
12661 __tmp.remaining(),
12662 )
12663 }
12664 __tmp.put_u32_le(self.flags.bits());
12665 __tmp.put_f32_le(self.pitch);
12666 __tmp.put_f32_le(self.yaw);
12667 __tmp.put_f32_le(self.pitch_rate);
12668 __tmp.put_f32_le(self.yaw_rate);
12669 __tmp.put_u8(self.target_system);
12670 __tmp.put_u8(self.target_component);
12671 __tmp.put_u8(self.gimbal_device_id);
12672 if matches!(version, MavlinkVersion::V2) {
12673 let len = __tmp.len();
12674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12675 } else {
12676 __tmp.len()
12677 }
12678 }
12679}
12680#[doc = "id: 287"]
12681#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12682#[derive(Debug, Clone, PartialEq)]
12683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12685pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12686 #[doc = "High level gimbal manager flags to use."]
12687 pub flags: GimbalManagerFlags,
12688 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
12689 pub pitch: f32,
12690 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
12691 pub yaw: f32,
12692 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
12693 pub pitch_rate: f32,
12694 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
12695 pub yaw_rate: f32,
12696 #[doc = "System ID"]
12697 pub target_system: u8,
12698 #[doc = "Component ID"]
12699 pub target_component: u8,
12700 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12701 pub gimbal_device_id: u8,
12702}
12703impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12704 pub const ENCODED_LEN: usize = 23usize;
12705 pub const DEFAULT: Self = Self {
12706 flags: GimbalManagerFlags::DEFAULT,
12707 pitch: 0.0_f32,
12708 yaw: 0.0_f32,
12709 pitch_rate: 0.0_f32,
12710 yaw_rate: 0.0_f32,
12711 target_system: 0_u8,
12712 target_component: 0_u8,
12713 gimbal_device_id: 0_u8,
12714 };
12715 #[cfg(feature = "arbitrary")]
12716 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12717 use arbitrary::{Arbitrary, Unstructured};
12718 let mut buf = [0u8; 1024];
12719 rng.fill_bytes(&mut buf);
12720 let mut unstructured = Unstructured::new(&buf);
12721 Self::arbitrary(&mut unstructured).unwrap_or_default()
12722 }
12723}
12724impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12725 fn default() -> Self {
12726 Self::DEFAULT.clone()
12727 }
12728}
12729impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12730 type Message = MavMessage;
12731 const ID: u32 = 287u32;
12732 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
12733 const EXTRA_CRC: u8 = 1u8;
12734 const ENCODED_LEN: usize = 23usize;
12735 fn deser(
12736 _version: MavlinkVersion,
12737 __input: &[u8],
12738 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12739 let avail_len = __input.len();
12740 let mut payload_buf = [0; Self::ENCODED_LEN];
12741 let mut buf = if avail_len < Self::ENCODED_LEN {
12742 payload_buf[0..avail_len].copy_from_slice(__input);
12743 Bytes::new(&payload_buf)
12744 } else {
12745 Bytes::new(__input)
12746 };
12747 let mut __struct = Self::default();
12748 let tmp = buf.get_u32_le();
12749 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12750 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12751 flag_type: "GimbalManagerFlags",
12752 value: tmp as u32,
12753 })?;
12754 __struct.pitch = buf.get_f32_le();
12755 __struct.yaw = buf.get_f32_le();
12756 __struct.pitch_rate = buf.get_f32_le();
12757 __struct.yaw_rate = buf.get_f32_le();
12758 __struct.target_system = buf.get_u8();
12759 __struct.target_component = buf.get_u8();
12760 __struct.gimbal_device_id = buf.get_u8();
12761 Ok(__struct)
12762 }
12763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12764 let mut __tmp = BytesMut::new(bytes);
12765 #[allow(clippy::absurd_extreme_comparisons)]
12766 #[allow(unused_comparisons)]
12767 if __tmp.remaining() < Self::ENCODED_LEN {
12768 panic!(
12769 "buffer is too small (need {} bytes, but got {})",
12770 Self::ENCODED_LEN,
12771 __tmp.remaining(),
12772 )
12773 }
12774 __tmp.put_u32_le(self.flags.bits());
12775 __tmp.put_f32_le(self.pitch);
12776 __tmp.put_f32_le(self.yaw);
12777 __tmp.put_f32_le(self.pitch_rate);
12778 __tmp.put_f32_le(self.yaw_rate);
12779 __tmp.put_u8(self.target_system);
12780 __tmp.put_u8(self.target_component);
12781 __tmp.put_u8(self.gimbal_device_id);
12782 if matches!(version, MavlinkVersion::V2) {
12783 let len = __tmp.len();
12784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12785 } else {
12786 __tmp.len()
12787 }
12788 }
12789}
12790#[doc = "id: 281"]
12791#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
12792#[derive(Debug, Clone, PartialEq)]
12793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12795pub struct GIMBAL_MANAGER_STATUS_DATA {
12796 #[doc = "Timestamp (time since system boot)."]
12797 pub time_boot_ms: u32,
12798 #[doc = "High level gimbal manager flags currently applied."]
12799 pub flags: GimbalManagerFlags,
12800 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12801 pub gimbal_device_id: u8,
12802 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
12803 pub primary_control_sysid: u8,
12804 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
12805 pub primary_control_compid: u8,
12806 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
12807 pub secondary_control_sysid: u8,
12808 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
12809 pub secondary_control_compid: u8,
12810}
12811impl GIMBAL_MANAGER_STATUS_DATA {
12812 pub const ENCODED_LEN: usize = 13usize;
12813 pub const DEFAULT: Self = Self {
12814 time_boot_ms: 0_u32,
12815 flags: GimbalManagerFlags::DEFAULT,
12816 gimbal_device_id: 0_u8,
12817 primary_control_sysid: 0_u8,
12818 primary_control_compid: 0_u8,
12819 secondary_control_sysid: 0_u8,
12820 secondary_control_compid: 0_u8,
12821 };
12822 #[cfg(feature = "arbitrary")]
12823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12824 use arbitrary::{Arbitrary, Unstructured};
12825 let mut buf = [0u8; 1024];
12826 rng.fill_bytes(&mut buf);
12827 let mut unstructured = Unstructured::new(&buf);
12828 Self::arbitrary(&mut unstructured).unwrap_or_default()
12829 }
12830}
12831impl Default for GIMBAL_MANAGER_STATUS_DATA {
12832 fn default() -> Self {
12833 Self::DEFAULT.clone()
12834 }
12835}
12836impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
12837 type Message = MavMessage;
12838 const ID: u32 = 281u32;
12839 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
12840 const EXTRA_CRC: u8 = 48u8;
12841 const ENCODED_LEN: usize = 13usize;
12842 fn deser(
12843 _version: MavlinkVersion,
12844 __input: &[u8],
12845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12846 let avail_len = __input.len();
12847 let mut payload_buf = [0; Self::ENCODED_LEN];
12848 let mut buf = if avail_len < Self::ENCODED_LEN {
12849 payload_buf[0..avail_len].copy_from_slice(__input);
12850 Bytes::new(&payload_buf)
12851 } else {
12852 Bytes::new(__input)
12853 };
12854 let mut __struct = Self::default();
12855 __struct.time_boot_ms = buf.get_u32_le();
12856 let tmp = buf.get_u32_le();
12857 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12858 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12859 flag_type: "GimbalManagerFlags",
12860 value: tmp as u32,
12861 })?;
12862 __struct.gimbal_device_id = buf.get_u8();
12863 __struct.primary_control_sysid = buf.get_u8();
12864 __struct.primary_control_compid = buf.get_u8();
12865 __struct.secondary_control_sysid = buf.get_u8();
12866 __struct.secondary_control_compid = buf.get_u8();
12867 Ok(__struct)
12868 }
12869 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12870 let mut __tmp = BytesMut::new(bytes);
12871 #[allow(clippy::absurd_extreme_comparisons)]
12872 #[allow(unused_comparisons)]
12873 if __tmp.remaining() < Self::ENCODED_LEN {
12874 panic!(
12875 "buffer is too small (need {} bytes, but got {})",
12876 Self::ENCODED_LEN,
12877 __tmp.remaining(),
12878 )
12879 }
12880 __tmp.put_u32_le(self.time_boot_ms);
12881 __tmp.put_u32_le(self.flags.bits());
12882 __tmp.put_u8(self.gimbal_device_id);
12883 __tmp.put_u8(self.primary_control_sysid);
12884 __tmp.put_u8(self.primary_control_compid);
12885 __tmp.put_u8(self.secondary_control_sysid);
12886 __tmp.put_u8(self.secondary_control_compid);
12887 if matches!(version, MavlinkVersion::V2) {
12888 let len = __tmp.len();
12889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12890 } else {
12891 __tmp.len()
12892 }
12893 }
12894}
12895#[doc = "id: 33"]
12896#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
12897#[derive(Debug, Clone, PartialEq)]
12898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12900pub struct GLOBAL_POSITION_INT_DATA {
12901 #[doc = "Timestamp (time since system boot)."]
12902 pub time_boot_ms: u32,
12903 #[doc = "Latitude, expressed"]
12904 pub lat: i32,
12905 #[doc = "Longitude, expressed"]
12906 pub lon: i32,
12907 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
12908 pub alt: i32,
12909 #[doc = "Altitude above home"]
12910 pub relative_alt: i32,
12911 #[doc = "Ground X Speed (Latitude, positive north)"]
12912 pub vx: i16,
12913 #[doc = "Ground Y Speed (Longitude, positive east)"]
12914 pub vy: i16,
12915 #[doc = "Ground Z Speed (Altitude, positive down)"]
12916 pub vz: i16,
12917 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
12918 pub hdg: u16,
12919}
12920impl GLOBAL_POSITION_INT_DATA {
12921 pub const ENCODED_LEN: usize = 28usize;
12922 pub const DEFAULT: Self = Self {
12923 time_boot_ms: 0_u32,
12924 lat: 0_i32,
12925 lon: 0_i32,
12926 alt: 0_i32,
12927 relative_alt: 0_i32,
12928 vx: 0_i16,
12929 vy: 0_i16,
12930 vz: 0_i16,
12931 hdg: 0_u16,
12932 };
12933 #[cfg(feature = "arbitrary")]
12934 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12935 use arbitrary::{Arbitrary, Unstructured};
12936 let mut buf = [0u8; 1024];
12937 rng.fill_bytes(&mut buf);
12938 let mut unstructured = Unstructured::new(&buf);
12939 Self::arbitrary(&mut unstructured).unwrap_or_default()
12940 }
12941}
12942impl Default for GLOBAL_POSITION_INT_DATA {
12943 fn default() -> Self {
12944 Self::DEFAULT.clone()
12945 }
12946}
12947impl MessageData for GLOBAL_POSITION_INT_DATA {
12948 type Message = MavMessage;
12949 const ID: u32 = 33u32;
12950 const NAME: &'static str = "GLOBAL_POSITION_INT";
12951 const EXTRA_CRC: u8 = 104u8;
12952 const ENCODED_LEN: usize = 28usize;
12953 fn deser(
12954 _version: MavlinkVersion,
12955 __input: &[u8],
12956 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12957 let avail_len = __input.len();
12958 let mut payload_buf = [0; Self::ENCODED_LEN];
12959 let mut buf = if avail_len < Self::ENCODED_LEN {
12960 payload_buf[0..avail_len].copy_from_slice(__input);
12961 Bytes::new(&payload_buf)
12962 } else {
12963 Bytes::new(__input)
12964 };
12965 let mut __struct = Self::default();
12966 __struct.time_boot_ms = buf.get_u32_le();
12967 __struct.lat = buf.get_i32_le();
12968 __struct.lon = buf.get_i32_le();
12969 __struct.alt = buf.get_i32_le();
12970 __struct.relative_alt = buf.get_i32_le();
12971 __struct.vx = buf.get_i16_le();
12972 __struct.vy = buf.get_i16_le();
12973 __struct.vz = buf.get_i16_le();
12974 __struct.hdg = buf.get_u16_le();
12975 Ok(__struct)
12976 }
12977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12978 let mut __tmp = BytesMut::new(bytes);
12979 #[allow(clippy::absurd_extreme_comparisons)]
12980 #[allow(unused_comparisons)]
12981 if __tmp.remaining() < Self::ENCODED_LEN {
12982 panic!(
12983 "buffer is too small (need {} bytes, but got {})",
12984 Self::ENCODED_LEN,
12985 __tmp.remaining(),
12986 )
12987 }
12988 __tmp.put_u32_le(self.time_boot_ms);
12989 __tmp.put_i32_le(self.lat);
12990 __tmp.put_i32_le(self.lon);
12991 __tmp.put_i32_le(self.alt);
12992 __tmp.put_i32_le(self.relative_alt);
12993 __tmp.put_i16_le(self.vx);
12994 __tmp.put_i16_le(self.vy);
12995 __tmp.put_i16_le(self.vz);
12996 __tmp.put_u16_le(self.hdg);
12997 if matches!(version, MavlinkVersion::V2) {
12998 let len = __tmp.len();
12999 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13000 } else {
13001 __tmp.len()
13002 }
13003 }
13004}
13005#[doc = "id: 63"]
13006#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13007#[derive(Debug, Clone, PartialEq)]
13008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13010pub struct GLOBAL_POSITION_INT_COV_DATA {
13011 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13012 pub time_usec: u64,
13013 #[doc = "Latitude"]
13014 pub lat: i32,
13015 #[doc = "Longitude"]
13016 pub lon: i32,
13017 #[doc = "Altitude in meters above MSL"]
13018 pub alt: i32,
13019 #[doc = "Altitude above ground"]
13020 pub relative_alt: i32,
13021 #[doc = "Ground X Speed (Latitude)"]
13022 pub vx: f32,
13023 #[doc = "Ground Y Speed (Longitude)"]
13024 pub vy: f32,
13025 #[doc = "Ground Z Speed (Altitude)"]
13026 pub vz: f32,
13027 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13028 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13029 pub covariance: [f32; 36],
13030 #[doc = "Class id of the estimator this estimate originated from."]
13031 pub estimator_type: MavEstimatorType,
13032}
13033impl GLOBAL_POSITION_INT_COV_DATA {
13034 pub const ENCODED_LEN: usize = 181usize;
13035 pub const DEFAULT: Self = Self {
13036 time_usec: 0_u64,
13037 lat: 0_i32,
13038 lon: 0_i32,
13039 alt: 0_i32,
13040 relative_alt: 0_i32,
13041 vx: 0.0_f32,
13042 vy: 0.0_f32,
13043 vz: 0.0_f32,
13044 covariance: [0.0_f32; 36usize],
13045 estimator_type: MavEstimatorType::DEFAULT,
13046 };
13047 #[cfg(feature = "arbitrary")]
13048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13049 use arbitrary::{Arbitrary, Unstructured};
13050 let mut buf = [0u8; 1024];
13051 rng.fill_bytes(&mut buf);
13052 let mut unstructured = Unstructured::new(&buf);
13053 Self::arbitrary(&mut unstructured).unwrap_or_default()
13054 }
13055}
13056impl Default for GLOBAL_POSITION_INT_COV_DATA {
13057 fn default() -> Self {
13058 Self::DEFAULT.clone()
13059 }
13060}
13061impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13062 type Message = MavMessage;
13063 const ID: u32 = 63u32;
13064 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13065 const EXTRA_CRC: u8 = 119u8;
13066 const ENCODED_LEN: usize = 181usize;
13067 fn deser(
13068 _version: MavlinkVersion,
13069 __input: &[u8],
13070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13071 let avail_len = __input.len();
13072 let mut payload_buf = [0; Self::ENCODED_LEN];
13073 let mut buf = if avail_len < Self::ENCODED_LEN {
13074 payload_buf[0..avail_len].copy_from_slice(__input);
13075 Bytes::new(&payload_buf)
13076 } else {
13077 Bytes::new(__input)
13078 };
13079 let mut __struct = Self::default();
13080 __struct.time_usec = buf.get_u64_le();
13081 __struct.lat = buf.get_i32_le();
13082 __struct.lon = buf.get_i32_le();
13083 __struct.alt = buf.get_i32_le();
13084 __struct.relative_alt = buf.get_i32_le();
13085 __struct.vx = buf.get_f32_le();
13086 __struct.vy = buf.get_f32_le();
13087 __struct.vz = buf.get_f32_le();
13088 for v in &mut __struct.covariance {
13089 let val = buf.get_f32_le();
13090 *v = val;
13091 }
13092 let tmp = buf.get_u8();
13093 __struct.estimator_type =
13094 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13095 enum_type: "MavEstimatorType",
13096 value: tmp as u32,
13097 })?;
13098 Ok(__struct)
13099 }
13100 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13101 let mut __tmp = BytesMut::new(bytes);
13102 #[allow(clippy::absurd_extreme_comparisons)]
13103 #[allow(unused_comparisons)]
13104 if __tmp.remaining() < Self::ENCODED_LEN {
13105 panic!(
13106 "buffer is too small (need {} bytes, but got {})",
13107 Self::ENCODED_LEN,
13108 __tmp.remaining(),
13109 )
13110 }
13111 __tmp.put_u64_le(self.time_usec);
13112 __tmp.put_i32_le(self.lat);
13113 __tmp.put_i32_le(self.lon);
13114 __tmp.put_i32_le(self.alt);
13115 __tmp.put_i32_le(self.relative_alt);
13116 __tmp.put_f32_le(self.vx);
13117 __tmp.put_f32_le(self.vy);
13118 __tmp.put_f32_le(self.vz);
13119 for val in &self.covariance {
13120 __tmp.put_f32_le(*val);
13121 }
13122 __tmp.put_u8(self.estimator_type as u8);
13123 if matches!(version, MavlinkVersion::V2) {
13124 let len = __tmp.len();
13125 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13126 } else {
13127 __tmp.len()
13128 }
13129 }
13130}
13131#[doc = "id: 101"]
13132#[doc = "Global position/attitude estimate from a vision source."]
13133#[derive(Debug, Clone, PartialEq)]
13134#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13136pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13137 #[doc = "Timestamp (UNIX time or since system boot)"]
13138 pub usec: u64,
13139 #[doc = "Global X position"]
13140 pub x: f32,
13141 #[doc = "Global Y position"]
13142 pub y: f32,
13143 #[doc = "Global Z position"]
13144 pub z: f32,
13145 #[doc = "Roll angle"]
13146 pub roll: f32,
13147 #[doc = "Pitch angle"]
13148 pub pitch: f32,
13149 #[doc = "Yaw angle"]
13150 pub yaw: f32,
13151 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13152 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13153 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13154 pub covariance: [f32; 21],
13155 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13156 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13157 pub reset_counter: u8,
13158}
13159impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13160 pub const ENCODED_LEN: usize = 117usize;
13161 pub const DEFAULT: Self = Self {
13162 usec: 0_u64,
13163 x: 0.0_f32,
13164 y: 0.0_f32,
13165 z: 0.0_f32,
13166 roll: 0.0_f32,
13167 pitch: 0.0_f32,
13168 yaw: 0.0_f32,
13169 covariance: [0.0_f32; 21usize],
13170 reset_counter: 0_u8,
13171 };
13172 #[cfg(feature = "arbitrary")]
13173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13174 use arbitrary::{Arbitrary, Unstructured};
13175 let mut buf = [0u8; 1024];
13176 rng.fill_bytes(&mut buf);
13177 let mut unstructured = Unstructured::new(&buf);
13178 Self::arbitrary(&mut unstructured).unwrap_or_default()
13179 }
13180}
13181impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13182 fn default() -> Self {
13183 Self::DEFAULT.clone()
13184 }
13185}
13186impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13187 type Message = MavMessage;
13188 const ID: u32 = 101u32;
13189 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13190 const EXTRA_CRC: u8 = 102u8;
13191 const ENCODED_LEN: usize = 117usize;
13192 fn deser(
13193 _version: MavlinkVersion,
13194 __input: &[u8],
13195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13196 let avail_len = __input.len();
13197 let mut payload_buf = [0; Self::ENCODED_LEN];
13198 let mut buf = if avail_len < Self::ENCODED_LEN {
13199 payload_buf[0..avail_len].copy_from_slice(__input);
13200 Bytes::new(&payload_buf)
13201 } else {
13202 Bytes::new(__input)
13203 };
13204 let mut __struct = Self::default();
13205 __struct.usec = buf.get_u64_le();
13206 __struct.x = buf.get_f32_le();
13207 __struct.y = buf.get_f32_le();
13208 __struct.z = buf.get_f32_le();
13209 __struct.roll = buf.get_f32_le();
13210 __struct.pitch = buf.get_f32_le();
13211 __struct.yaw = buf.get_f32_le();
13212 for v in &mut __struct.covariance {
13213 let val = buf.get_f32_le();
13214 *v = val;
13215 }
13216 __struct.reset_counter = buf.get_u8();
13217 Ok(__struct)
13218 }
13219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13220 let mut __tmp = BytesMut::new(bytes);
13221 #[allow(clippy::absurd_extreme_comparisons)]
13222 #[allow(unused_comparisons)]
13223 if __tmp.remaining() < Self::ENCODED_LEN {
13224 panic!(
13225 "buffer is too small (need {} bytes, but got {})",
13226 Self::ENCODED_LEN,
13227 __tmp.remaining(),
13228 )
13229 }
13230 __tmp.put_u64_le(self.usec);
13231 __tmp.put_f32_le(self.x);
13232 __tmp.put_f32_le(self.y);
13233 __tmp.put_f32_le(self.z);
13234 __tmp.put_f32_le(self.roll);
13235 __tmp.put_f32_le(self.pitch);
13236 __tmp.put_f32_le(self.yaw);
13237 for val in &self.covariance {
13238 __tmp.put_f32_le(*val);
13239 }
13240 __tmp.put_u8(self.reset_counter);
13241 if matches!(version, MavlinkVersion::V2) {
13242 let len = __tmp.len();
13243 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13244 } else {
13245 __tmp.len()
13246 }
13247 }
13248}
13249#[doc = "id: 124"]
13250#[doc = "Second GPS data."]
13251#[derive(Debug, Clone, PartialEq)]
13252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13254pub struct GPS2_RAW_DATA {
13255 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13256 pub time_usec: u64,
13257 #[doc = "Latitude (WGS84)"]
13258 pub lat: i32,
13259 #[doc = "Longitude (WGS84)"]
13260 pub lon: i32,
13261 #[doc = "Altitude (MSL). Positive for up."]
13262 pub alt: i32,
13263 #[doc = "Age of DGPS info"]
13264 pub dgps_age: u32,
13265 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13266 pub eph: u16,
13267 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13268 pub epv: u16,
13269 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13270 pub vel: u16,
13271 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13272 pub cog: u16,
13273 #[doc = "GPS fix type."]
13274 pub fix_type: GpsFixType,
13275 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13276 pub satellites_visible: u8,
13277 #[doc = "Number of DGPS satellites"]
13278 pub dgps_numch: u8,
13279 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13280 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13281 pub yaw: u16,
13282 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13283 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13284 pub alt_ellipsoid: i32,
13285 #[doc = "Position uncertainty."]
13286 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13287 pub h_acc: u32,
13288 #[doc = "Altitude uncertainty."]
13289 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13290 pub v_acc: u32,
13291 #[doc = "Speed uncertainty."]
13292 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13293 pub vel_acc: u32,
13294 #[doc = "Heading / track uncertainty"]
13295 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13296 pub hdg_acc: u32,
13297}
13298impl GPS2_RAW_DATA {
13299 pub const ENCODED_LEN: usize = 57usize;
13300 pub const DEFAULT: Self = Self {
13301 time_usec: 0_u64,
13302 lat: 0_i32,
13303 lon: 0_i32,
13304 alt: 0_i32,
13305 dgps_age: 0_u32,
13306 eph: 0_u16,
13307 epv: 0_u16,
13308 vel: 0_u16,
13309 cog: 0_u16,
13310 fix_type: GpsFixType::DEFAULT,
13311 satellites_visible: 0_u8,
13312 dgps_numch: 0_u8,
13313 yaw: 0_u16,
13314 alt_ellipsoid: 0_i32,
13315 h_acc: 0_u32,
13316 v_acc: 0_u32,
13317 vel_acc: 0_u32,
13318 hdg_acc: 0_u32,
13319 };
13320 #[cfg(feature = "arbitrary")]
13321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13322 use arbitrary::{Arbitrary, Unstructured};
13323 let mut buf = [0u8; 1024];
13324 rng.fill_bytes(&mut buf);
13325 let mut unstructured = Unstructured::new(&buf);
13326 Self::arbitrary(&mut unstructured).unwrap_or_default()
13327 }
13328}
13329impl Default for GPS2_RAW_DATA {
13330 fn default() -> Self {
13331 Self::DEFAULT.clone()
13332 }
13333}
13334impl MessageData for GPS2_RAW_DATA {
13335 type Message = MavMessage;
13336 const ID: u32 = 124u32;
13337 const NAME: &'static str = "GPS2_RAW";
13338 const EXTRA_CRC: u8 = 87u8;
13339 const ENCODED_LEN: usize = 57usize;
13340 fn deser(
13341 _version: MavlinkVersion,
13342 __input: &[u8],
13343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13344 let avail_len = __input.len();
13345 let mut payload_buf = [0; Self::ENCODED_LEN];
13346 let mut buf = if avail_len < Self::ENCODED_LEN {
13347 payload_buf[0..avail_len].copy_from_slice(__input);
13348 Bytes::new(&payload_buf)
13349 } else {
13350 Bytes::new(__input)
13351 };
13352 let mut __struct = Self::default();
13353 __struct.time_usec = buf.get_u64_le();
13354 __struct.lat = buf.get_i32_le();
13355 __struct.lon = buf.get_i32_le();
13356 __struct.alt = buf.get_i32_le();
13357 __struct.dgps_age = buf.get_u32_le();
13358 __struct.eph = buf.get_u16_le();
13359 __struct.epv = buf.get_u16_le();
13360 __struct.vel = buf.get_u16_le();
13361 __struct.cog = buf.get_u16_le();
13362 let tmp = buf.get_u8();
13363 __struct.fix_type =
13364 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13365 enum_type: "GpsFixType",
13366 value: tmp as u32,
13367 })?;
13368 __struct.satellites_visible = buf.get_u8();
13369 __struct.dgps_numch = buf.get_u8();
13370 __struct.yaw = buf.get_u16_le();
13371 __struct.alt_ellipsoid = buf.get_i32_le();
13372 __struct.h_acc = buf.get_u32_le();
13373 __struct.v_acc = buf.get_u32_le();
13374 __struct.vel_acc = buf.get_u32_le();
13375 __struct.hdg_acc = buf.get_u32_le();
13376 Ok(__struct)
13377 }
13378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13379 let mut __tmp = BytesMut::new(bytes);
13380 #[allow(clippy::absurd_extreme_comparisons)]
13381 #[allow(unused_comparisons)]
13382 if __tmp.remaining() < Self::ENCODED_LEN {
13383 panic!(
13384 "buffer is too small (need {} bytes, but got {})",
13385 Self::ENCODED_LEN,
13386 __tmp.remaining(),
13387 )
13388 }
13389 __tmp.put_u64_le(self.time_usec);
13390 __tmp.put_i32_le(self.lat);
13391 __tmp.put_i32_le(self.lon);
13392 __tmp.put_i32_le(self.alt);
13393 __tmp.put_u32_le(self.dgps_age);
13394 __tmp.put_u16_le(self.eph);
13395 __tmp.put_u16_le(self.epv);
13396 __tmp.put_u16_le(self.vel);
13397 __tmp.put_u16_le(self.cog);
13398 __tmp.put_u8(self.fix_type as u8);
13399 __tmp.put_u8(self.satellites_visible);
13400 __tmp.put_u8(self.dgps_numch);
13401 __tmp.put_u16_le(self.yaw);
13402 __tmp.put_i32_le(self.alt_ellipsoid);
13403 __tmp.put_u32_le(self.h_acc);
13404 __tmp.put_u32_le(self.v_acc);
13405 __tmp.put_u32_le(self.vel_acc);
13406 __tmp.put_u32_le(self.hdg_acc);
13407 if matches!(version, MavlinkVersion::V2) {
13408 let len = __tmp.len();
13409 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13410 } else {
13411 __tmp.len()
13412 }
13413 }
13414}
13415#[doc = "id: 128"]
13416#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13417#[derive(Debug, Clone, PartialEq)]
13418#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13420pub struct GPS2_RTK_DATA {
13421 #[doc = "Time since boot of last baseline message received."]
13422 pub time_last_baseline_ms: u32,
13423 #[doc = "GPS Time of Week of last baseline"]
13424 pub tow: u32,
13425 #[doc = "Current baseline in ECEF x or NED north component."]
13426 pub baseline_a_mm: i32,
13427 #[doc = "Current baseline in ECEF y or NED east component."]
13428 pub baseline_b_mm: i32,
13429 #[doc = "Current baseline in ECEF z or NED down component."]
13430 pub baseline_c_mm: i32,
13431 #[doc = "Current estimate of baseline accuracy."]
13432 pub accuracy: u32,
13433 #[doc = "Current number of integer ambiguity hypotheses."]
13434 pub iar_num_hypotheses: i32,
13435 #[doc = "GPS Week Number of last baseline"]
13436 pub wn: u16,
13437 #[doc = "Identification of connected RTK receiver."]
13438 pub rtk_receiver_id: u8,
13439 #[doc = "GPS-specific health report for RTK data."]
13440 pub rtk_health: u8,
13441 #[doc = "Rate of baseline messages being received by GPS"]
13442 pub rtk_rate: u8,
13443 #[doc = "Current number of sats used for RTK calculation."]
13444 pub nsats: u8,
13445 #[doc = "Coordinate system of baseline"]
13446 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13447}
13448impl GPS2_RTK_DATA {
13449 pub const ENCODED_LEN: usize = 35usize;
13450 pub const DEFAULT: Self = Self {
13451 time_last_baseline_ms: 0_u32,
13452 tow: 0_u32,
13453 baseline_a_mm: 0_i32,
13454 baseline_b_mm: 0_i32,
13455 baseline_c_mm: 0_i32,
13456 accuracy: 0_u32,
13457 iar_num_hypotheses: 0_i32,
13458 wn: 0_u16,
13459 rtk_receiver_id: 0_u8,
13460 rtk_health: 0_u8,
13461 rtk_rate: 0_u8,
13462 nsats: 0_u8,
13463 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13464 };
13465 #[cfg(feature = "arbitrary")]
13466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13467 use arbitrary::{Arbitrary, Unstructured};
13468 let mut buf = [0u8; 1024];
13469 rng.fill_bytes(&mut buf);
13470 let mut unstructured = Unstructured::new(&buf);
13471 Self::arbitrary(&mut unstructured).unwrap_or_default()
13472 }
13473}
13474impl Default for GPS2_RTK_DATA {
13475 fn default() -> Self {
13476 Self::DEFAULT.clone()
13477 }
13478}
13479impl MessageData for GPS2_RTK_DATA {
13480 type Message = MavMessage;
13481 const ID: u32 = 128u32;
13482 const NAME: &'static str = "GPS2_RTK";
13483 const EXTRA_CRC: u8 = 226u8;
13484 const ENCODED_LEN: usize = 35usize;
13485 fn deser(
13486 _version: MavlinkVersion,
13487 __input: &[u8],
13488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13489 let avail_len = __input.len();
13490 let mut payload_buf = [0; Self::ENCODED_LEN];
13491 let mut buf = if avail_len < Self::ENCODED_LEN {
13492 payload_buf[0..avail_len].copy_from_slice(__input);
13493 Bytes::new(&payload_buf)
13494 } else {
13495 Bytes::new(__input)
13496 };
13497 let mut __struct = Self::default();
13498 __struct.time_last_baseline_ms = buf.get_u32_le();
13499 __struct.tow = buf.get_u32_le();
13500 __struct.baseline_a_mm = buf.get_i32_le();
13501 __struct.baseline_b_mm = buf.get_i32_le();
13502 __struct.baseline_c_mm = buf.get_i32_le();
13503 __struct.accuracy = buf.get_u32_le();
13504 __struct.iar_num_hypotheses = buf.get_i32_le();
13505 __struct.wn = buf.get_u16_le();
13506 __struct.rtk_receiver_id = buf.get_u8();
13507 __struct.rtk_health = buf.get_u8();
13508 __struct.rtk_rate = buf.get_u8();
13509 __struct.nsats = buf.get_u8();
13510 let tmp = buf.get_u8();
13511 __struct.baseline_coords_type =
13512 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13513 enum_type: "RtkBaselineCoordinateSystem",
13514 value: tmp as u32,
13515 })?;
13516 Ok(__struct)
13517 }
13518 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13519 let mut __tmp = BytesMut::new(bytes);
13520 #[allow(clippy::absurd_extreme_comparisons)]
13521 #[allow(unused_comparisons)]
13522 if __tmp.remaining() < Self::ENCODED_LEN {
13523 panic!(
13524 "buffer is too small (need {} bytes, but got {})",
13525 Self::ENCODED_LEN,
13526 __tmp.remaining(),
13527 )
13528 }
13529 __tmp.put_u32_le(self.time_last_baseline_ms);
13530 __tmp.put_u32_le(self.tow);
13531 __tmp.put_i32_le(self.baseline_a_mm);
13532 __tmp.put_i32_le(self.baseline_b_mm);
13533 __tmp.put_i32_le(self.baseline_c_mm);
13534 __tmp.put_u32_le(self.accuracy);
13535 __tmp.put_i32_le(self.iar_num_hypotheses);
13536 __tmp.put_u16_le(self.wn);
13537 __tmp.put_u8(self.rtk_receiver_id);
13538 __tmp.put_u8(self.rtk_health);
13539 __tmp.put_u8(self.rtk_rate);
13540 __tmp.put_u8(self.nsats);
13541 __tmp.put_u8(self.baseline_coords_type as u8);
13542 if matches!(version, MavlinkVersion::V2) {
13543 let len = __tmp.len();
13544 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13545 } else {
13546 __tmp.len()
13547 }
13548 }
13549}
13550#[doc = "id: 49"]
13551#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13552#[derive(Debug, Clone, PartialEq)]
13553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13555pub struct GPS_GLOBAL_ORIGIN_DATA {
13556 #[doc = "Latitude (WGS84)"]
13557 pub latitude: i32,
13558 #[doc = "Longitude (WGS84)"]
13559 pub longitude: i32,
13560 #[doc = "Altitude (MSL). Positive for up."]
13561 pub altitude: i32,
13562 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13563 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13564 pub time_usec: u64,
13565}
13566impl GPS_GLOBAL_ORIGIN_DATA {
13567 pub const ENCODED_LEN: usize = 20usize;
13568 pub const DEFAULT: Self = Self {
13569 latitude: 0_i32,
13570 longitude: 0_i32,
13571 altitude: 0_i32,
13572 time_usec: 0_u64,
13573 };
13574 #[cfg(feature = "arbitrary")]
13575 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13576 use arbitrary::{Arbitrary, Unstructured};
13577 let mut buf = [0u8; 1024];
13578 rng.fill_bytes(&mut buf);
13579 let mut unstructured = Unstructured::new(&buf);
13580 Self::arbitrary(&mut unstructured).unwrap_or_default()
13581 }
13582}
13583impl Default for GPS_GLOBAL_ORIGIN_DATA {
13584 fn default() -> Self {
13585 Self::DEFAULT.clone()
13586 }
13587}
13588impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13589 type Message = MavMessage;
13590 const ID: u32 = 49u32;
13591 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13592 const EXTRA_CRC: u8 = 39u8;
13593 const ENCODED_LEN: usize = 20usize;
13594 fn deser(
13595 _version: MavlinkVersion,
13596 __input: &[u8],
13597 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13598 let avail_len = __input.len();
13599 let mut payload_buf = [0; Self::ENCODED_LEN];
13600 let mut buf = if avail_len < Self::ENCODED_LEN {
13601 payload_buf[0..avail_len].copy_from_slice(__input);
13602 Bytes::new(&payload_buf)
13603 } else {
13604 Bytes::new(__input)
13605 };
13606 let mut __struct = Self::default();
13607 __struct.latitude = buf.get_i32_le();
13608 __struct.longitude = buf.get_i32_le();
13609 __struct.altitude = buf.get_i32_le();
13610 __struct.time_usec = buf.get_u64_le();
13611 Ok(__struct)
13612 }
13613 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13614 let mut __tmp = BytesMut::new(bytes);
13615 #[allow(clippy::absurd_extreme_comparisons)]
13616 #[allow(unused_comparisons)]
13617 if __tmp.remaining() < Self::ENCODED_LEN {
13618 panic!(
13619 "buffer is too small (need {} bytes, but got {})",
13620 Self::ENCODED_LEN,
13621 __tmp.remaining(),
13622 )
13623 }
13624 __tmp.put_i32_le(self.latitude);
13625 __tmp.put_i32_le(self.longitude);
13626 __tmp.put_i32_le(self.altitude);
13627 __tmp.put_u64_le(self.time_usec);
13628 if matches!(version, MavlinkVersion::V2) {
13629 let len = __tmp.len();
13630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13631 } else {
13632 __tmp.len()
13633 }
13634 }
13635}
13636#[doc = "id: 123"]
13637#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
13638#[derive(Debug, Clone, PartialEq)]
13639#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13640#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13641pub struct GPS_INJECT_DATA_DATA {
13642 #[doc = "System ID"]
13643 pub target_system: u8,
13644 #[doc = "Component ID"]
13645 pub target_component: u8,
13646 #[doc = "Data length"]
13647 pub len: u8,
13648 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
13649 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13650 pub data: [u8; 110],
13651}
13652impl GPS_INJECT_DATA_DATA {
13653 pub const ENCODED_LEN: usize = 113usize;
13654 pub const DEFAULT: Self = Self {
13655 target_system: 0_u8,
13656 target_component: 0_u8,
13657 len: 0_u8,
13658 data: [0_u8; 110usize],
13659 };
13660 #[cfg(feature = "arbitrary")]
13661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13662 use arbitrary::{Arbitrary, Unstructured};
13663 let mut buf = [0u8; 1024];
13664 rng.fill_bytes(&mut buf);
13665 let mut unstructured = Unstructured::new(&buf);
13666 Self::arbitrary(&mut unstructured).unwrap_or_default()
13667 }
13668}
13669impl Default for GPS_INJECT_DATA_DATA {
13670 fn default() -> Self {
13671 Self::DEFAULT.clone()
13672 }
13673}
13674impl MessageData for GPS_INJECT_DATA_DATA {
13675 type Message = MavMessage;
13676 const ID: u32 = 123u32;
13677 const NAME: &'static str = "GPS_INJECT_DATA";
13678 const EXTRA_CRC: u8 = 250u8;
13679 const ENCODED_LEN: usize = 113usize;
13680 fn deser(
13681 _version: MavlinkVersion,
13682 __input: &[u8],
13683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13684 let avail_len = __input.len();
13685 let mut payload_buf = [0; Self::ENCODED_LEN];
13686 let mut buf = if avail_len < Self::ENCODED_LEN {
13687 payload_buf[0..avail_len].copy_from_slice(__input);
13688 Bytes::new(&payload_buf)
13689 } else {
13690 Bytes::new(__input)
13691 };
13692 let mut __struct = Self::default();
13693 __struct.target_system = buf.get_u8();
13694 __struct.target_component = buf.get_u8();
13695 __struct.len = buf.get_u8();
13696 for v in &mut __struct.data {
13697 let val = buf.get_u8();
13698 *v = val;
13699 }
13700 Ok(__struct)
13701 }
13702 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13703 let mut __tmp = BytesMut::new(bytes);
13704 #[allow(clippy::absurd_extreme_comparisons)]
13705 #[allow(unused_comparisons)]
13706 if __tmp.remaining() < Self::ENCODED_LEN {
13707 panic!(
13708 "buffer is too small (need {} bytes, but got {})",
13709 Self::ENCODED_LEN,
13710 __tmp.remaining(),
13711 )
13712 }
13713 __tmp.put_u8(self.target_system);
13714 __tmp.put_u8(self.target_component);
13715 __tmp.put_u8(self.len);
13716 for val in &self.data {
13717 __tmp.put_u8(*val);
13718 }
13719 if matches!(version, MavlinkVersion::V2) {
13720 let len = __tmp.len();
13721 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13722 } else {
13723 __tmp.len()
13724 }
13725 }
13726}
13727#[doc = "id: 232"]
13728#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
13729#[derive(Debug, Clone, PartialEq)]
13730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13732pub struct GPS_INPUT_DATA {
13733 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13734 pub time_usec: u64,
13735 #[doc = "GPS time (from start of GPS week)"]
13736 pub time_week_ms: u32,
13737 #[doc = "Latitude (WGS84)"]
13738 pub lat: i32,
13739 #[doc = "Longitude (WGS84)"]
13740 pub lon: i32,
13741 #[doc = "Altitude (MSL). Positive for up."]
13742 pub alt: f32,
13743 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13744 pub hdop: f32,
13745 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13746 pub vdop: f32,
13747 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
13748 pub vn: f32,
13749 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
13750 pub ve: f32,
13751 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
13752 pub vd: f32,
13753 #[doc = "GPS speed accuracy"]
13754 pub speed_accuracy: f32,
13755 #[doc = "GPS horizontal accuracy"]
13756 pub horiz_accuracy: f32,
13757 #[doc = "GPS vertical accuracy"]
13758 pub vert_accuracy: f32,
13759 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
13760 pub ignore_flags: GpsInputIgnoreFlags,
13761 #[doc = "GPS week number"]
13762 pub time_week: u16,
13763 #[doc = "ID of the GPS for multiple GPS inputs"]
13764 pub gps_id: u8,
13765 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
13766 pub fix_type: u8,
13767 #[doc = "Number of satellites visible."]
13768 pub satellites_visible: u8,
13769 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
13770 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13771 pub yaw: u16,
13772}
13773impl GPS_INPUT_DATA {
13774 pub const ENCODED_LEN: usize = 65usize;
13775 pub const DEFAULT: Self = Self {
13776 time_usec: 0_u64,
13777 time_week_ms: 0_u32,
13778 lat: 0_i32,
13779 lon: 0_i32,
13780 alt: 0.0_f32,
13781 hdop: 0.0_f32,
13782 vdop: 0.0_f32,
13783 vn: 0.0_f32,
13784 ve: 0.0_f32,
13785 vd: 0.0_f32,
13786 speed_accuracy: 0.0_f32,
13787 horiz_accuracy: 0.0_f32,
13788 vert_accuracy: 0.0_f32,
13789 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
13790 time_week: 0_u16,
13791 gps_id: 0_u8,
13792 fix_type: 0_u8,
13793 satellites_visible: 0_u8,
13794 yaw: 0_u16,
13795 };
13796 #[cfg(feature = "arbitrary")]
13797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13798 use arbitrary::{Arbitrary, Unstructured};
13799 let mut buf = [0u8; 1024];
13800 rng.fill_bytes(&mut buf);
13801 let mut unstructured = Unstructured::new(&buf);
13802 Self::arbitrary(&mut unstructured).unwrap_or_default()
13803 }
13804}
13805impl Default for GPS_INPUT_DATA {
13806 fn default() -> Self {
13807 Self::DEFAULT.clone()
13808 }
13809}
13810impl MessageData for GPS_INPUT_DATA {
13811 type Message = MavMessage;
13812 const ID: u32 = 232u32;
13813 const NAME: &'static str = "GPS_INPUT";
13814 const EXTRA_CRC: u8 = 151u8;
13815 const ENCODED_LEN: usize = 65usize;
13816 fn deser(
13817 _version: MavlinkVersion,
13818 __input: &[u8],
13819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13820 let avail_len = __input.len();
13821 let mut payload_buf = [0; Self::ENCODED_LEN];
13822 let mut buf = if avail_len < Self::ENCODED_LEN {
13823 payload_buf[0..avail_len].copy_from_slice(__input);
13824 Bytes::new(&payload_buf)
13825 } else {
13826 Bytes::new(__input)
13827 };
13828 let mut __struct = Self::default();
13829 __struct.time_usec = buf.get_u64_le();
13830 __struct.time_week_ms = buf.get_u32_le();
13831 __struct.lat = buf.get_i32_le();
13832 __struct.lon = buf.get_i32_le();
13833 __struct.alt = buf.get_f32_le();
13834 __struct.hdop = buf.get_f32_le();
13835 __struct.vdop = buf.get_f32_le();
13836 __struct.vn = buf.get_f32_le();
13837 __struct.ve = buf.get_f32_le();
13838 __struct.vd = buf.get_f32_le();
13839 __struct.speed_accuracy = buf.get_f32_le();
13840 __struct.horiz_accuracy = buf.get_f32_le();
13841 __struct.vert_accuracy = buf.get_f32_le();
13842 let tmp = buf.get_u16_le();
13843 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
13844 tmp & GpsInputIgnoreFlags::all().bits(),
13845 )
13846 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13847 flag_type: "GpsInputIgnoreFlags",
13848 value: tmp as u32,
13849 })?;
13850 __struct.time_week = buf.get_u16_le();
13851 __struct.gps_id = buf.get_u8();
13852 __struct.fix_type = buf.get_u8();
13853 __struct.satellites_visible = buf.get_u8();
13854 __struct.yaw = buf.get_u16_le();
13855 Ok(__struct)
13856 }
13857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13858 let mut __tmp = BytesMut::new(bytes);
13859 #[allow(clippy::absurd_extreme_comparisons)]
13860 #[allow(unused_comparisons)]
13861 if __tmp.remaining() < Self::ENCODED_LEN {
13862 panic!(
13863 "buffer is too small (need {} bytes, but got {})",
13864 Self::ENCODED_LEN,
13865 __tmp.remaining(),
13866 )
13867 }
13868 __tmp.put_u64_le(self.time_usec);
13869 __tmp.put_u32_le(self.time_week_ms);
13870 __tmp.put_i32_le(self.lat);
13871 __tmp.put_i32_le(self.lon);
13872 __tmp.put_f32_le(self.alt);
13873 __tmp.put_f32_le(self.hdop);
13874 __tmp.put_f32_le(self.vdop);
13875 __tmp.put_f32_le(self.vn);
13876 __tmp.put_f32_le(self.ve);
13877 __tmp.put_f32_le(self.vd);
13878 __tmp.put_f32_le(self.speed_accuracy);
13879 __tmp.put_f32_le(self.horiz_accuracy);
13880 __tmp.put_f32_le(self.vert_accuracy);
13881 __tmp.put_u16_le(self.ignore_flags.bits());
13882 __tmp.put_u16_le(self.time_week);
13883 __tmp.put_u8(self.gps_id);
13884 __tmp.put_u8(self.fix_type);
13885 __tmp.put_u8(self.satellites_visible);
13886 __tmp.put_u16_le(self.yaw);
13887 if matches!(version, MavlinkVersion::V2) {
13888 let len = __tmp.len();
13889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13890 } else {
13891 __tmp.len()
13892 }
13893 }
13894}
13895#[doc = "id: 24"]
13896#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
13897#[derive(Debug, Clone, PartialEq)]
13898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13900pub struct GPS_RAW_INT_DATA {
13901 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13902 pub time_usec: u64,
13903 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
13904 pub lat: i32,
13905 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
13906 pub lon: i32,
13907 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
13908 pub alt: i32,
13909 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13910 pub eph: u16,
13911 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13912 pub epv: u16,
13913 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13914 pub vel: u16,
13915 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13916 pub cog: u16,
13917 #[doc = "GPS fix type."]
13918 pub fix_type: GpsFixType,
13919 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13920 pub satellites_visible: u8,
13921 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13922 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13923 pub alt_ellipsoid: i32,
13924 #[doc = "Position uncertainty."]
13925 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13926 pub h_acc: u32,
13927 #[doc = "Altitude uncertainty."]
13928 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13929 pub v_acc: u32,
13930 #[doc = "Speed uncertainty."]
13931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13932 pub vel_acc: u32,
13933 #[doc = "Heading / track uncertainty"]
13934 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13935 pub hdg_acc: u32,
13936 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13937 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13938 pub yaw: u16,
13939}
13940impl GPS_RAW_INT_DATA {
13941 pub const ENCODED_LEN: usize = 52usize;
13942 pub const DEFAULT: Self = Self {
13943 time_usec: 0_u64,
13944 lat: 0_i32,
13945 lon: 0_i32,
13946 alt: 0_i32,
13947 eph: 0_u16,
13948 epv: 0_u16,
13949 vel: 0_u16,
13950 cog: 0_u16,
13951 fix_type: GpsFixType::DEFAULT,
13952 satellites_visible: 0_u8,
13953 alt_ellipsoid: 0_i32,
13954 h_acc: 0_u32,
13955 v_acc: 0_u32,
13956 vel_acc: 0_u32,
13957 hdg_acc: 0_u32,
13958 yaw: 0_u16,
13959 };
13960 #[cfg(feature = "arbitrary")]
13961 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13962 use arbitrary::{Arbitrary, Unstructured};
13963 let mut buf = [0u8; 1024];
13964 rng.fill_bytes(&mut buf);
13965 let mut unstructured = Unstructured::new(&buf);
13966 Self::arbitrary(&mut unstructured).unwrap_or_default()
13967 }
13968}
13969impl Default for GPS_RAW_INT_DATA {
13970 fn default() -> Self {
13971 Self::DEFAULT.clone()
13972 }
13973}
13974impl MessageData for GPS_RAW_INT_DATA {
13975 type Message = MavMessage;
13976 const ID: u32 = 24u32;
13977 const NAME: &'static str = "GPS_RAW_INT";
13978 const EXTRA_CRC: u8 = 24u8;
13979 const ENCODED_LEN: usize = 52usize;
13980 fn deser(
13981 _version: MavlinkVersion,
13982 __input: &[u8],
13983 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13984 let avail_len = __input.len();
13985 let mut payload_buf = [0; Self::ENCODED_LEN];
13986 let mut buf = if avail_len < Self::ENCODED_LEN {
13987 payload_buf[0..avail_len].copy_from_slice(__input);
13988 Bytes::new(&payload_buf)
13989 } else {
13990 Bytes::new(__input)
13991 };
13992 let mut __struct = Self::default();
13993 __struct.time_usec = buf.get_u64_le();
13994 __struct.lat = buf.get_i32_le();
13995 __struct.lon = buf.get_i32_le();
13996 __struct.alt = buf.get_i32_le();
13997 __struct.eph = buf.get_u16_le();
13998 __struct.epv = buf.get_u16_le();
13999 __struct.vel = buf.get_u16_le();
14000 __struct.cog = buf.get_u16_le();
14001 let tmp = buf.get_u8();
14002 __struct.fix_type =
14003 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14004 enum_type: "GpsFixType",
14005 value: tmp as u32,
14006 })?;
14007 __struct.satellites_visible = buf.get_u8();
14008 __struct.alt_ellipsoid = buf.get_i32_le();
14009 __struct.h_acc = buf.get_u32_le();
14010 __struct.v_acc = buf.get_u32_le();
14011 __struct.vel_acc = buf.get_u32_le();
14012 __struct.hdg_acc = buf.get_u32_le();
14013 __struct.yaw = buf.get_u16_le();
14014 Ok(__struct)
14015 }
14016 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14017 let mut __tmp = BytesMut::new(bytes);
14018 #[allow(clippy::absurd_extreme_comparisons)]
14019 #[allow(unused_comparisons)]
14020 if __tmp.remaining() < Self::ENCODED_LEN {
14021 panic!(
14022 "buffer is too small (need {} bytes, but got {})",
14023 Self::ENCODED_LEN,
14024 __tmp.remaining(),
14025 )
14026 }
14027 __tmp.put_u64_le(self.time_usec);
14028 __tmp.put_i32_le(self.lat);
14029 __tmp.put_i32_le(self.lon);
14030 __tmp.put_i32_le(self.alt);
14031 __tmp.put_u16_le(self.eph);
14032 __tmp.put_u16_le(self.epv);
14033 __tmp.put_u16_le(self.vel);
14034 __tmp.put_u16_le(self.cog);
14035 __tmp.put_u8(self.fix_type as u8);
14036 __tmp.put_u8(self.satellites_visible);
14037 __tmp.put_i32_le(self.alt_ellipsoid);
14038 __tmp.put_u32_le(self.h_acc);
14039 __tmp.put_u32_le(self.v_acc);
14040 __tmp.put_u32_le(self.vel_acc);
14041 __tmp.put_u32_le(self.hdg_acc);
14042 __tmp.put_u16_le(self.yaw);
14043 if matches!(version, MavlinkVersion::V2) {
14044 let len = __tmp.len();
14045 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14046 } else {
14047 __tmp.len()
14048 }
14049 }
14050}
14051#[doc = "id: 233"]
14052#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14053#[derive(Debug, Clone, PartialEq)]
14054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14056pub struct GPS_RTCM_DATA_DATA {
14057 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14058 pub flags: u8,
14059 #[doc = "data length"]
14060 pub len: u8,
14061 #[doc = "RTCM message (may be fragmented)"]
14062 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14063 pub data: [u8; 180],
14064}
14065impl GPS_RTCM_DATA_DATA {
14066 pub const ENCODED_LEN: usize = 182usize;
14067 pub const DEFAULT: Self = Self {
14068 flags: 0_u8,
14069 len: 0_u8,
14070 data: [0_u8; 180usize],
14071 };
14072 #[cfg(feature = "arbitrary")]
14073 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14074 use arbitrary::{Arbitrary, Unstructured};
14075 let mut buf = [0u8; 1024];
14076 rng.fill_bytes(&mut buf);
14077 let mut unstructured = Unstructured::new(&buf);
14078 Self::arbitrary(&mut unstructured).unwrap_or_default()
14079 }
14080}
14081impl Default for GPS_RTCM_DATA_DATA {
14082 fn default() -> Self {
14083 Self::DEFAULT.clone()
14084 }
14085}
14086impl MessageData for GPS_RTCM_DATA_DATA {
14087 type Message = MavMessage;
14088 const ID: u32 = 233u32;
14089 const NAME: &'static str = "GPS_RTCM_DATA";
14090 const EXTRA_CRC: u8 = 35u8;
14091 const ENCODED_LEN: usize = 182usize;
14092 fn deser(
14093 _version: MavlinkVersion,
14094 __input: &[u8],
14095 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14096 let avail_len = __input.len();
14097 let mut payload_buf = [0; Self::ENCODED_LEN];
14098 let mut buf = if avail_len < Self::ENCODED_LEN {
14099 payload_buf[0..avail_len].copy_from_slice(__input);
14100 Bytes::new(&payload_buf)
14101 } else {
14102 Bytes::new(__input)
14103 };
14104 let mut __struct = Self::default();
14105 __struct.flags = buf.get_u8();
14106 __struct.len = buf.get_u8();
14107 for v in &mut __struct.data {
14108 let val = buf.get_u8();
14109 *v = val;
14110 }
14111 Ok(__struct)
14112 }
14113 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14114 let mut __tmp = BytesMut::new(bytes);
14115 #[allow(clippy::absurd_extreme_comparisons)]
14116 #[allow(unused_comparisons)]
14117 if __tmp.remaining() < Self::ENCODED_LEN {
14118 panic!(
14119 "buffer is too small (need {} bytes, but got {})",
14120 Self::ENCODED_LEN,
14121 __tmp.remaining(),
14122 )
14123 }
14124 __tmp.put_u8(self.flags);
14125 __tmp.put_u8(self.len);
14126 for val in &self.data {
14127 __tmp.put_u8(*val);
14128 }
14129 if matches!(version, MavlinkVersion::V2) {
14130 let len = __tmp.len();
14131 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14132 } else {
14133 __tmp.len()
14134 }
14135 }
14136}
14137#[doc = "id: 127"]
14138#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14139#[derive(Debug, Clone, PartialEq)]
14140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14141#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14142pub struct GPS_RTK_DATA {
14143 #[doc = "Time since boot of last baseline message received."]
14144 pub time_last_baseline_ms: u32,
14145 #[doc = "GPS Time of Week of last baseline"]
14146 pub tow: u32,
14147 #[doc = "Current baseline in ECEF x or NED north component."]
14148 pub baseline_a_mm: i32,
14149 #[doc = "Current baseline in ECEF y or NED east component."]
14150 pub baseline_b_mm: i32,
14151 #[doc = "Current baseline in ECEF z or NED down component."]
14152 pub baseline_c_mm: i32,
14153 #[doc = "Current estimate of baseline accuracy."]
14154 pub accuracy: u32,
14155 #[doc = "Current number of integer ambiguity hypotheses."]
14156 pub iar_num_hypotheses: i32,
14157 #[doc = "GPS Week Number of last baseline"]
14158 pub wn: u16,
14159 #[doc = "Identification of connected RTK receiver."]
14160 pub rtk_receiver_id: u8,
14161 #[doc = "GPS-specific health report for RTK data."]
14162 pub rtk_health: u8,
14163 #[doc = "Rate of baseline messages being received by GPS"]
14164 pub rtk_rate: u8,
14165 #[doc = "Current number of sats used for RTK calculation."]
14166 pub nsats: u8,
14167 #[doc = "Coordinate system of baseline"]
14168 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14169}
14170impl GPS_RTK_DATA {
14171 pub const ENCODED_LEN: usize = 35usize;
14172 pub const DEFAULT: Self = Self {
14173 time_last_baseline_ms: 0_u32,
14174 tow: 0_u32,
14175 baseline_a_mm: 0_i32,
14176 baseline_b_mm: 0_i32,
14177 baseline_c_mm: 0_i32,
14178 accuracy: 0_u32,
14179 iar_num_hypotheses: 0_i32,
14180 wn: 0_u16,
14181 rtk_receiver_id: 0_u8,
14182 rtk_health: 0_u8,
14183 rtk_rate: 0_u8,
14184 nsats: 0_u8,
14185 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14186 };
14187 #[cfg(feature = "arbitrary")]
14188 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14189 use arbitrary::{Arbitrary, Unstructured};
14190 let mut buf = [0u8; 1024];
14191 rng.fill_bytes(&mut buf);
14192 let mut unstructured = Unstructured::new(&buf);
14193 Self::arbitrary(&mut unstructured).unwrap_or_default()
14194 }
14195}
14196impl Default for GPS_RTK_DATA {
14197 fn default() -> Self {
14198 Self::DEFAULT.clone()
14199 }
14200}
14201impl MessageData for GPS_RTK_DATA {
14202 type Message = MavMessage;
14203 const ID: u32 = 127u32;
14204 const NAME: &'static str = "GPS_RTK";
14205 const EXTRA_CRC: u8 = 25u8;
14206 const ENCODED_LEN: usize = 35usize;
14207 fn deser(
14208 _version: MavlinkVersion,
14209 __input: &[u8],
14210 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14211 let avail_len = __input.len();
14212 let mut payload_buf = [0; Self::ENCODED_LEN];
14213 let mut buf = if avail_len < Self::ENCODED_LEN {
14214 payload_buf[0..avail_len].copy_from_slice(__input);
14215 Bytes::new(&payload_buf)
14216 } else {
14217 Bytes::new(__input)
14218 };
14219 let mut __struct = Self::default();
14220 __struct.time_last_baseline_ms = buf.get_u32_le();
14221 __struct.tow = buf.get_u32_le();
14222 __struct.baseline_a_mm = buf.get_i32_le();
14223 __struct.baseline_b_mm = buf.get_i32_le();
14224 __struct.baseline_c_mm = buf.get_i32_le();
14225 __struct.accuracy = buf.get_u32_le();
14226 __struct.iar_num_hypotheses = buf.get_i32_le();
14227 __struct.wn = buf.get_u16_le();
14228 __struct.rtk_receiver_id = buf.get_u8();
14229 __struct.rtk_health = buf.get_u8();
14230 __struct.rtk_rate = buf.get_u8();
14231 __struct.nsats = buf.get_u8();
14232 let tmp = buf.get_u8();
14233 __struct.baseline_coords_type =
14234 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14235 enum_type: "RtkBaselineCoordinateSystem",
14236 value: tmp as u32,
14237 })?;
14238 Ok(__struct)
14239 }
14240 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14241 let mut __tmp = BytesMut::new(bytes);
14242 #[allow(clippy::absurd_extreme_comparisons)]
14243 #[allow(unused_comparisons)]
14244 if __tmp.remaining() < Self::ENCODED_LEN {
14245 panic!(
14246 "buffer is too small (need {} bytes, but got {})",
14247 Self::ENCODED_LEN,
14248 __tmp.remaining(),
14249 )
14250 }
14251 __tmp.put_u32_le(self.time_last_baseline_ms);
14252 __tmp.put_u32_le(self.tow);
14253 __tmp.put_i32_le(self.baseline_a_mm);
14254 __tmp.put_i32_le(self.baseline_b_mm);
14255 __tmp.put_i32_le(self.baseline_c_mm);
14256 __tmp.put_u32_le(self.accuracy);
14257 __tmp.put_i32_le(self.iar_num_hypotheses);
14258 __tmp.put_u16_le(self.wn);
14259 __tmp.put_u8(self.rtk_receiver_id);
14260 __tmp.put_u8(self.rtk_health);
14261 __tmp.put_u8(self.rtk_rate);
14262 __tmp.put_u8(self.nsats);
14263 __tmp.put_u8(self.baseline_coords_type as u8);
14264 if matches!(version, MavlinkVersion::V2) {
14265 let len = __tmp.len();
14266 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14267 } else {
14268 __tmp.len()
14269 }
14270 }
14271}
14272#[doc = "id: 25"]
14273#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14274#[derive(Debug, Clone, PartialEq)]
14275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14277pub struct GPS_STATUS_DATA {
14278 #[doc = "Number of satellites visible"]
14279 pub satellites_visible: u8,
14280 #[doc = "Global satellite ID"]
14281 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14282 pub satellite_prn: [u8; 20],
14283 #[doc = "0: Satellite not used, 1: used for localization"]
14284 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14285 pub satellite_used: [u8; 20],
14286 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14287 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14288 pub satellite_elevation: [u8; 20],
14289 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14290 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14291 pub satellite_azimuth: [u8; 20],
14292 #[doc = "Signal to noise ratio of satellite"]
14293 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14294 pub satellite_snr: [u8; 20],
14295}
14296impl GPS_STATUS_DATA {
14297 pub const ENCODED_LEN: usize = 101usize;
14298 pub const DEFAULT: Self = Self {
14299 satellites_visible: 0_u8,
14300 satellite_prn: [0_u8; 20usize],
14301 satellite_used: [0_u8; 20usize],
14302 satellite_elevation: [0_u8; 20usize],
14303 satellite_azimuth: [0_u8; 20usize],
14304 satellite_snr: [0_u8; 20usize],
14305 };
14306 #[cfg(feature = "arbitrary")]
14307 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14308 use arbitrary::{Arbitrary, Unstructured};
14309 let mut buf = [0u8; 1024];
14310 rng.fill_bytes(&mut buf);
14311 let mut unstructured = Unstructured::new(&buf);
14312 Self::arbitrary(&mut unstructured).unwrap_or_default()
14313 }
14314}
14315impl Default for GPS_STATUS_DATA {
14316 fn default() -> Self {
14317 Self::DEFAULT.clone()
14318 }
14319}
14320impl MessageData for GPS_STATUS_DATA {
14321 type Message = MavMessage;
14322 const ID: u32 = 25u32;
14323 const NAME: &'static str = "GPS_STATUS";
14324 const EXTRA_CRC: u8 = 23u8;
14325 const ENCODED_LEN: usize = 101usize;
14326 fn deser(
14327 _version: MavlinkVersion,
14328 __input: &[u8],
14329 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14330 let avail_len = __input.len();
14331 let mut payload_buf = [0; Self::ENCODED_LEN];
14332 let mut buf = if avail_len < Self::ENCODED_LEN {
14333 payload_buf[0..avail_len].copy_from_slice(__input);
14334 Bytes::new(&payload_buf)
14335 } else {
14336 Bytes::new(__input)
14337 };
14338 let mut __struct = Self::default();
14339 __struct.satellites_visible = buf.get_u8();
14340 for v in &mut __struct.satellite_prn {
14341 let val = buf.get_u8();
14342 *v = val;
14343 }
14344 for v in &mut __struct.satellite_used {
14345 let val = buf.get_u8();
14346 *v = val;
14347 }
14348 for v in &mut __struct.satellite_elevation {
14349 let val = buf.get_u8();
14350 *v = val;
14351 }
14352 for v in &mut __struct.satellite_azimuth {
14353 let val = buf.get_u8();
14354 *v = val;
14355 }
14356 for v in &mut __struct.satellite_snr {
14357 let val = buf.get_u8();
14358 *v = val;
14359 }
14360 Ok(__struct)
14361 }
14362 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14363 let mut __tmp = BytesMut::new(bytes);
14364 #[allow(clippy::absurd_extreme_comparisons)]
14365 #[allow(unused_comparisons)]
14366 if __tmp.remaining() < Self::ENCODED_LEN {
14367 panic!(
14368 "buffer is too small (need {} bytes, but got {})",
14369 Self::ENCODED_LEN,
14370 __tmp.remaining(),
14371 )
14372 }
14373 __tmp.put_u8(self.satellites_visible);
14374 for val in &self.satellite_prn {
14375 __tmp.put_u8(*val);
14376 }
14377 for val in &self.satellite_used {
14378 __tmp.put_u8(*val);
14379 }
14380 for val in &self.satellite_elevation {
14381 __tmp.put_u8(*val);
14382 }
14383 for val in &self.satellite_azimuth {
14384 __tmp.put_u8(*val);
14385 }
14386 for val in &self.satellite_snr {
14387 __tmp.put_u8(*val);
14388 }
14389 if matches!(version, MavlinkVersion::V2) {
14390 let len = __tmp.len();
14391 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14392 } else {
14393 __tmp.len()
14394 }
14395 }
14396}
14397#[doc = "id: 0"]
14398#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14399#[derive(Debug, Clone, PartialEq)]
14400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14402pub struct HEARTBEAT_DATA {
14403 #[doc = "A bitfield for use for autopilot-specific flags"]
14404 pub custom_mode: u32,
14405 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14406 pub mavtype: MavType,
14407 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14408 pub autopilot: MavAutopilot,
14409 #[doc = "System mode bitmap."]
14410 pub base_mode: MavModeFlag,
14411 #[doc = "System status flag."]
14412 pub system_status: MavState,
14413 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14414 pub mavlink_version: u8,
14415}
14416impl HEARTBEAT_DATA {
14417 pub const ENCODED_LEN: usize = 9usize;
14418 pub const DEFAULT: Self = Self {
14419 custom_mode: 0_u32,
14420 mavtype: MavType::DEFAULT,
14421 autopilot: MavAutopilot::DEFAULT,
14422 base_mode: MavModeFlag::DEFAULT,
14423 system_status: MavState::DEFAULT,
14424 mavlink_version: 0_u8,
14425 };
14426 #[cfg(feature = "arbitrary")]
14427 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14428 use arbitrary::{Arbitrary, Unstructured};
14429 let mut buf = [0u8; 1024];
14430 rng.fill_bytes(&mut buf);
14431 let mut unstructured = Unstructured::new(&buf);
14432 Self::arbitrary(&mut unstructured).unwrap_or_default()
14433 }
14434}
14435impl Default for HEARTBEAT_DATA {
14436 fn default() -> Self {
14437 Self::DEFAULT.clone()
14438 }
14439}
14440impl MessageData for HEARTBEAT_DATA {
14441 type Message = MavMessage;
14442 const ID: u32 = 0u32;
14443 const NAME: &'static str = "HEARTBEAT";
14444 const EXTRA_CRC: u8 = 50u8;
14445 const ENCODED_LEN: usize = 9usize;
14446 fn deser(
14447 _version: MavlinkVersion,
14448 __input: &[u8],
14449 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14450 let avail_len = __input.len();
14451 let mut payload_buf = [0; Self::ENCODED_LEN];
14452 let mut buf = if avail_len < Self::ENCODED_LEN {
14453 payload_buf[0..avail_len].copy_from_slice(__input);
14454 Bytes::new(&payload_buf)
14455 } else {
14456 Bytes::new(__input)
14457 };
14458 let mut __struct = Self::default();
14459 __struct.custom_mode = buf.get_u32_le();
14460 let tmp = buf.get_u8();
14461 __struct.mavtype =
14462 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14463 enum_type: "MavType",
14464 value: tmp as u32,
14465 })?;
14466 let tmp = buf.get_u8();
14467 __struct.autopilot =
14468 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14469 enum_type: "MavAutopilot",
14470 value: tmp as u32,
14471 })?;
14472 let tmp = buf.get_u8();
14473 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14474 ::mavlink_core::error::ParserError::InvalidFlag {
14475 flag_type: "MavModeFlag",
14476 value: tmp as u32,
14477 },
14478 )?;
14479 let tmp = buf.get_u8();
14480 __struct.system_status =
14481 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14482 enum_type: "MavState",
14483 value: tmp as u32,
14484 })?;
14485 __struct.mavlink_version = buf.get_u8();
14486 Ok(__struct)
14487 }
14488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14489 let mut __tmp = BytesMut::new(bytes);
14490 #[allow(clippy::absurd_extreme_comparisons)]
14491 #[allow(unused_comparisons)]
14492 if __tmp.remaining() < Self::ENCODED_LEN {
14493 panic!(
14494 "buffer is too small (need {} bytes, but got {})",
14495 Self::ENCODED_LEN,
14496 __tmp.remaining(),
14497 )
14498 }
14499 __tmp.put_u32_le(self.custom_mode);
14500 __tmp.put_u8(self.mavtype as u8);
14501 __tmp.put_u8(self.autopilot as u8);
14502 __tmp.put_u8(self.base_mode.bits());
14503 __tmp.put_u8(self.system_status as u8);
14504 __tmp.put_u8(self.mavlink_version);
14505 if matches!(version, MavlinkVersion::V2) {
14506 let len = __tmp.len();
14507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14508 } else {
14509 __tmp.len()
14510 }
14511 }
14512}
14513#[doc = "id: 50003"]
14514#[doc = "Herelink Telemetry."]
14515#[derive(Debug, Clone, PartialEq)]
14516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14517#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14518pub struct HERELINK_TELEM_DATA {}
14519impl HERELINK_TELEM_DATA {
14520 pub const ENCODED_LEN: usize = 0usize;
14521 pub const DEFAULT: Self = Self {};
14522 #[cfg(feature = "arbitrary")]
14523 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14524 use arbitrary::{Arbitrary, Unstructured};
14525 let mut buf = [0u8; 1024];
14526 rng.fill_bytes(&mut buf);
14527 let mut unstructured = Unstructured::new(&buf);
14528 Self::arbitrary(&mut unstructured).unwrap_or_default()
14529 }
14530}
14531impl Default for HERELINK_TELEM_DATA {
14532 fn default() -> Self {
14533 Self::DEFAULT.clone()
14534 }
14535}
14536impl MessageData for HERELINK_TELEM_DATA {
14537 type Message = MavMessage;
14538 const ID: u32 = 50003u32;
14539 const NAME: &'static str = "HERELINK_TELEM";
14540 const EXTRA_CRC: u8 = 53u8;
14541 const ENCODED_LEN: usize = 0usize;
14542 fn deser(
14543 _version: MavlinkVersion,
14544 __input: &[u8],
14545 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14546 Ok(Self::default())
14547 }
14548 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14549 let mut __tmp = BytesMut::new(bytes);
14550 #[allow(clippy::absurd_extreme_comparisons)]
14551 #[allow(unused_comparisons)]
14552 if __tmp.remaining() < Self::ENCODED_LEN {
14553 panic!(
14554 "buffer is too small (need {} bytes, but got {})",
14555 Self::ENCODED_LEN,
14556 __tmp.remaining(),
14557 )
14558 }
14559 if matches!(version, MavlinkVersion::V2) {
14560 let len = __tmp.len();
14561 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14562 } else {
14563 __tmp.len()
14564 }
14565 }
14566}
14567#[doc = "id: 50002"]
14568#[doc = "Information about video stream."]
14569#[derive(Debug, Clone, PartialEq)]
14570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14572pub struct HERELINK_VIDEO_STREAM_INFORMATION_DATA {
14573 #[doc = "Frame rate."]
14574 pub framerate: f32,
14575 #[doc = "Bit rate."]
14576 pub bitrate: u32,
14577 #[doc = "Horizontal resolution."]
14578 pub resolution_h: u16,
14579 #[doc = "Vertical resolution."]
14580 pub resolution_v: u16,
14581 #[doc = "Video image rotation clockwise."]
14582 pub rotation: u16,
14583 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
14584 pub camera_id: u8,
14585 #[doc = "Number of streams available."]
14586 pub status: u8,
14587 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
14588 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14589 pub uri: [u8; 230],
14590}
14591impl HERELINK_VIDEO_STREAM_INFORMATION_DATA {
14592 pub const ENCODED_LEN: usize = 246usize;
14593 pub const DEFAULT: Self = Self {
14594 framerate: 0.0_f32,
14595 bitrate: 0_u32,
14596 resolution_h: 0_u16,
14597 resolution_v: 0_u16,
14598 rotation: 0_u16,
14599 camera_id: 0_u8,
14600 status: 0_u8,
14601 uri: [0_u8; 230usize],
14602 };
14603 #[cfg(feature = "arbitrary")]
14604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14605 use arbitrary::{Arbitrary, Unstructured};
14606 let mut buf = [0u8; 1024];
14607 rng.fill_bytes(&mut buf);
14608 let mut unstructured = Unstructured::new(&buf);
14609 Self::arbitrary(&mut unstructured).unwrap_or_default()
14610 }
14611}
14612impl Default for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
14613 fn default() -> Self {
14614 Self::DEFAULT.clone()
14615 }
14616}
14617impl MessageData for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
14618 type Message = MavMessage;
14619 const ID: u32 = 50002u32;
14620 const NAME: &'static str = "HERELINK_VIDEO_STREAM_INFORMATION";
14621 const EXTRA_CRC: u8 = 181u8;
14622 const ENCODED_LEN: usize = 246usize;
14623 fn deser(
14624 _version: MavlinkVersion,
14625 __input: &[u8],
14626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14627 let avail_len = __input.len();
14628 let mut payload_buf = [0; Self::ENCODED_LEN];
14629 let mut buf = if avail_len < Self::ENCODED_LEN {
14630 payload_buf[0..avail_len].copy_from_slice(__input);
14631 Bytes::new(&payload_buf)
14632 } else {
14633 Bytes::new(__input)
14634 };
14635 let mut __struct = Self::default();
14636 __struct.framerate = buf.get_f32_le();
14637 __struct.bitrate = buf.get_u32_le();
14638 __struct.resolution_h = buf.get_u16_le();
14639 __struct.resolution_v = buf.get_u16_le();
14640 __struct.rotation = buf.get_u16_le();
14641 __struct.camera_id = buf.get_u8();
14642 __struct.status = buf.get_u8();
14643 for v in &mut __struct.uri {
14644 let val = buf.get_u8();
14645 *v = val;
14646 }
14647 Ok(__struct)
14648 }
14649 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14650 let mut __tmp = BytesMut::new(bytes);
14651 #[allow(clippy::absurd_extreme_comparisons)]
14652 #[allow(unused_comparisons)]
14653 if __tmp.remaining() < Self::ENCODED_LEN {
14654 panic!(
14655 "buffer is too small (need {} bytes, but got {})",
14656 Self::ENCODED_LEN,
14657 __tmp.remaining(),
14658 )
14659 }
14660 __tmp.put_f32_le(self.framerate);
14661 __tmp.put_u32_le(self.bitrate);
14662 __tmp.put_u16_le(self.resolution_h);
14663 __tmp.put_u16_le(self.resolution_v);
14664 __tmp.put_u16_le(self.rotation);
14665 __tmp.put_u8(self.camera_id);
14666 __tmp.put_u8(self.status);
14667 for val in &self.uri {
14668 __tmp.put_u8(*val);
14669 }
14670 if matches!(version, MavlinkVersion::V2) {
14671 let len = __tmp.len();
14672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14673 } else {
14674 __tmp.len()
14675 }
14676 }
14677}
14678#[doc = "id: 105"]
14679#[doc = "The IMU readings in SI units in NED body frame."]
14680#[derive(Debug, Clone, PartialEq)]
14681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14683pub struct HIGHRES_IMU_DATA {
14684 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14685 pub time_usec: u64,
14686 #[doc = "X acceleration"]
14687 pub xacc: f32,
14688 #[doc = "Y acceleration"]
14689 pub yacc: f32,
14690 #[doc = "Z acceleration"]
14691 pub zacc: f32,
14692 #[doc = "Angular speed around X axis"]
14693 pub xgyro: f32,
14694 #[doc = "Angular speed around Y axis"]
14695 pub ygyro: f32,
14696 #[doc = "Angular speed around Z axis"]
14697 pub zgyro: f32,
14698 #[doc = "X Magnetic field"]
14699 pub xmag: f32,
14700 #[doc = "Y Magnetic field"]
14701 pub ymag: f32,
14702 #[doc = "Z Magnetic field"]
14703 pub zmag: f32,
14704 #[doc = "Absolute pressure"]
14705 pub abs_pressure: f32,
14706 #[doc = "Differential pressure"]
14707 pub diff_pressure: f32,
14708 #[doc = "Altitude calculated from pressure"]
14709 pub pressure_alt: f32,
14710 #[doc = "Temperature"]
14711 pub temperature: f32,
14712 #[doc = "Bitmap for fields that have updated since last message"]
14713 pub fields_updated: HighresImuUpdatedFlags,
14714 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14715 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14716 pub id: u8,
14717}
14718impl HIGHRES_IMU_DATA {
14719 pub const ENCODED_LEN: usize = 63usize;
14720 pub const DEFAULT: Self = Self {
14721 time_usec: 0_u64,
14722 xacc: 0.0_f32,
14723 yacc: 0.0_f32,
14724 zacc: 0.0_f32,
14725 xgyro: 0.0_f32,
14726 ygyro: 0.0_f32,
14727 zgyro: 0.0_f32,
14728 xmag: 0.0_f32,
14729 ymag: 0.0_f32,
14730 zmag: 0.0_f32,
14731 abs_pressure: 0.0_f32,
14732 diff_pressure: 0.0_f32,
14733 pressure_alt: 0.0_f32,
14734 temperature: 0.0_f32,
14735 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14736 id: 0_u8,
14737 };
14738 #[cfg(feature = "arbitrary")]
14739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14740 use arbitrary::{Arbitrary, Unstructured};
14741 let mut buf = [0u8; 1024];
14742 rng.fill_bytes(&mut buf);
14743 let mut unstructured = Unstructured::new(&buf);
14744 Self::arbitrary(&mut unstructured).unwrap_or_default()
14745 }
14746}
14747impl Default for HIGHRES_IMU_DATA {
14748 fn default() -> Self {
14749 Self::DEFAULT.clone()
14750 }
14751}
14752impl MessageData for HIGHRES_IMU_DATA {
14753 type Message = MavMessage;
14754 const ID: u32 = 105u32;
14755 const NAME: &'static str = "HIGHRES_IMU";
14756 const EXTRA_CRC: u8 = 93u8;
14757 const ENCODED_LEN: usize = 63usize;
14758 fn deser(
14759 _version: MavlinkVersion,
14760 __input: &[u8],
14761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14762 let avail_len = __input.len();
14763 let mut payload_buf = [0; Self::ENCODED_LEN];
14764 let mut buf = if avail_len < Self::ENCODED_LEN {
14765 payload_buf[0..avail_len].copy_from_slice(__input);
14766 Bytes::new(&payload_buf)
14767 } else {
14768 Bytes::new(__input)
14769 };
14770 let mut __struct = Self::default();
14771 __struct.time_usec = buf.get_u64_le();
14772 __struct.xacc = buf.get_f32_le();
14773 __struct.yacc = buf.get_f32_le();
14774 __struct.zacc = buf.get_f32_le();
14775 __struct.xgyro = buf.get_f32_le();
14776 __struct.ygyro = buf.get_f32_le();
14777 __struct.zgyro = buf.get_f32_le();
14778 __struct.xmag = buf.get_f32_le();
14779 __struct.ymag = buf.get_f32_le();
14780 __struct.zmag = buf.get_f32_le();
14781 __struct.abs_pressure = buf.get_f32_le();
14782 __struct.diff_pressure = buf.get_f32_le();
14783 __struct.pressure_alt = buf.get_f32_le();
14784 __struct.temperature = buf.get_f32_le();
14785 let tmp = buf.get_u16_le();
14786 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
14787 tmp & HighresImuUpdatedFlags::all().bits(),
14788 )
14789 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14790 flag_type: "HighresImuUpdatedFlags",
14791 value: tmp as u32,
14792 })?;
14793 __struct.id = buf.get_u8();
14794 Ok(__struct)
14795 }
14796 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14797 let mut __tmp = BytesMut::new(bytes);
14798 #[allow(clippy::absurd_extreme_comparisons)]
14799 #[allow(unused_comparisons)]
14800 if __tmp.remaining() < Self::ENCODED_LEN {
14801 panic!(
14802 "buffer is too small (need {} bytes, but got {})",
14803 Self::ENCODED_LEN,
14804 __tmp.remaining(),
14805 )
14806 }
14807 __tmp.put_u64_le(self.time_usec);
14808 __tmp.put_f32_le(self.xacc);
14809 __tmp.put_f32_le(self.yacc);
14810 __tmp.put_f32_le(self.zacc);
14811 __tmp.put_f32_le(self.xgyro);
14812 __tmp.put_f32_le(self.ygyro);
14813 __tmp.put_f32_le(self.zgyro);
14814 __tmp.put_f32_le(self.xmag);
14815 __tmp.put_f32_le(self.ymag);
14816 __tmp.put_f32_le(self.zmag);
14817 __tmp.put_f32_le(self.abs_pressure);
14818 __tmp.put_f32_le(self.diff_pressure);
14819 __tmp.put_f32_le(self.pressure_alt);
14820 __tmp.put_f32_le(self.temperature);
14821 __tmp.put_u16_le(self.fields_updated.bits());
14822 __tmp.put_u8(self.id);
14823 if matches!(version, MavlinkVersion::V2) {
14824 let len = __tmp.len();
14825 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14826 } else {
14827 __tmp.len()
14828 }
14829 }
14830}
14831#[doc = "id: 234"]
14832#[doc = "Message appropriate for high latency connections like Iridium."]
14833#[derive(Debug, Clone, PartialEq)]
14834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14836pub struct HIGH_LATENCY_DATA {
14837 #[doc = "A bitfield for use for autopilot-specific flags."]
14838 pub custom_mode: u32,
14839 #[doc = "Latitude"]
14840 pub latitude: i32,
14841 #[doc = "Longitude"]
14842 pub longitude: i32,
14843 #[doc = "roll"]
14844 pub roll: i16,
14845 #[doc = "pitch"]
14846 pub pitch: i16,
14847 #[doc = "heading"]
14848 pub heading: u16,
14849 #[doc = "heading setpoint"]
14850 pub heading_sp: i16,
14851 #[doc = "Altitude above mean sea level"]
14852 pub altitude_amsl: i16,
14853 #[doc = "Altitude setpoint relative to the home position"]
14854 pub altitude_sp: i16,
14855 #[doc = "distance to target"]
14856 pub wp_distance: u16,
14857 #[doc = "Bitmap of enabled system modes."]
14858 pub base_mode: MavModeFlag,
14859 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
14860 pub landed_state: MavLandedState,
14861 #[doc = "throttle (percentage)"]
14862 pub throttle: i8,
14863 #[doc = "airspeed"]
14864 pub airspeed: u8,
14865 #[doc = "airspeed setpoint"]
14866 pub airspeed_sp: u8,
14867 #[doc = "groundspeed"]
14868 pub groundspeed: u8,
14869 #[doc = "climb rate"]
14870 pub climb_rate: i8,
14871 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14872 pub gps_nsat: u8,
14873 #[doc = "GPS Fix type."]
14874 pub gps_fix_type: GpsFixType,
14875 #[doc = "Remaining battery (percentage)"]
14876 pub battery_remaining: u8,
14877 #[doc = "Autopilot temperature (degrees C)"]
14878 pub temperature: i8,
14879 #[doc = "Air temperature (degrees C) from airspeed sensor"]
14880 pub temperature_air: i8,
14881 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
14882 pub failsafe: u8,
14883 #[doc = "current waypoint number"]
14884 pub wp_num: u8,
14885}
14886impl HIGH_LATENCY_DATA {
14887 pub const ENCODED_LEN: usize = 40usize;
14888 pub const DEFAULT: Self = Self {
14889 custom_mode: 0_u32,
14890 latitude: 0_i32,
14891 longitude: 0_i32,
14892 roll: 0_i16,
14893 pitch: 0_i16,
14894 heading: 0_u16,
14895 heading_sp: 0_i16,
14896 altitude_amsl: 0_i16,
14897 altitude_sp: 0_i16,
14898 wp_distance: 0_u16,
14899 base_mode: MavModeFlag::DEFAULT,
14900 landed_state: MavLandedState::DEFAULT,
14901 throttle: 0_i8,
14902 airspeed: 0_u8,
14903 airspeed_sp: 0_u8,
14904 groundspeed: 0_u8,
14905 climb_rate: 0_i8,
14906 gps_nsat: 0_u8,
14907 gps_fix_type: GpsFixType::DEFAULT,
14908 battery_remaining: 0_u8,
14909 temperature: 0_i8,
14910 temperature_air: 0_i8,
14911 failsafe: 0_u8,
14912 wp_num: 0_u8,
14913 };
14914 #[cfg(feature = "arbitrary")]
14915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14916 use arbitrary::{Arbitrary, Unstructured};
14917 let mut buf = [0u8; 1024];
14918 rng.fill_bytes(&mut buf);
14919 let mut unstructured = Unstructured::new(&buf);
14920 Self::arbitrary(&mut unstructured).unwrap_or_default()
14921 }
14922}
14923impl Default for HIGH_LATENCY_DATA {
14924 fn default() -> Self {
14925 Self::DEFAULT.clone()
14926 }
14927}
14928impl MessageData for HIGH_LATENCY_DATA {
14929 type Message = MavMessage;
14930 const ID: u32 = 234u32;
14931 const NAME: &'static str = "HIGH_LATENCY";
14932 const EXTRA_CRC: u8 = 150u8;
14933 const ENCODED_LEN: usize = 40usize;
14934 fn deser(
14935 _version: MavlinkVersion,
14936 __input: &[u8],
14937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14938 let avail_len = __input.len();
14939 let mut payload_buf = [0; Self::ENCODED_LEN];
14940 let mut buf = if avail_len < Self::ENCODED_LEN {
14941 payload_buf[0..avail_len].copy_from_slice(__input);
14942 Bytes::new(&payload_buf)
14943 } else {
14944 Bytes::new(__input)
14945 };
14946 let mut __struct = Self::default();
14947 __struct.custom_mode = buf.get_u32_le();
14948 __struct.latitude = buf.get_i32_le();
14949 __struct.longitude = buf.get_i32_le();
14950 __struct.roll = buf.get_i16_le();
14951 __struct.pitch = buf.get_i16_le();
14952 __struct.heading = buf.get_u16_le();
14953 __struct.heading_sp = buf.get_i16_le();
14954 __struct.altitude_amsl = buf.get_i16_le();
14955 __struct.altitude_sp = buf.get_i16_le();
14956 __struct.wp_distance = buf.get_u16_le();
14957 let tmp = buf.get_u8();
14958 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14959 ::mavlink_core::error::ParserError::InvalidFlag {
14960 flag_type: "MavModeFlag",
14961 value: tmp as u32,
14962 },
14963 )?;
14964 let tmp = buf.get_u8();
14965 __struct.landed_state =
14966 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14967 enum_type: "MavLandedState",
14968 value: tmp as u32,
14969 })?;
14970 __struct.throttle = buf.get_i8();
14971 __struct.airspeed = buf.get_u8();
14972 __struct.airspeed_sp = buf.get_u8();
14973 __struct.groundspeed = buf.get_u8();
14974 __struct.climb_rate = buf.get_i8();
14975 __struct.gps_nsat = buf.get_u8();
14976 let tmp = buf.get_u8();
14977 __struct.gps_fix_type =
14978 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14979 enum_type: "GpsFixType",
14980 value: tmp as u32,
14981 })?;
14982 __struct.battery_remaining = buf.get_u8();
14983 __struct.temperature = buf.get_i8();
14984 __struct.temperature_air = buf.get_i8();
14985 __struct.failsafe = buf.get_u8();
14986 __struct.wp_num = buf.get_u8();
14987 Ok(__struct)
14988 }
14989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14990 let mut __tmp = BytesMut::new(bytes);
14991 #[allow(clippy::absurd_extreme_comparisons)]
14992 #[allow(unused_comparisons)]
14993 if __tmp.remaining() < Self::ENCODED_LEN {
14994 panic!(
14995 "buffer is too small (need {} bytes, but got {})",
14996 Self::ENCODED_LEN,
14997 __tmp.remaining(),
14998 )
14999 }
15000 __tmp.put_u32_le(self.custom_mode);
15001 __tmp.put_i32_le(self.latitude);
15002 __tmp.put_i32_le(self.longitude);
15003 __tmp.put_i16_le(self.roll);
15004 __tmp.put_i16_le(self.pitch);
15005 __tmp.put_u16_le(self.heading);
15006 __tmp.put_i16_le(self.heading_sp);
15007 __tmp.put_i16_le(self.altitude_amsl);
15008 __tmp.put_i16_le(self.altitude_sp);
15009 __tmp.put_u16_le(self.wp_distance);
15010 __tmp.put_u8(self.base_mode.bits());
15011 __tmp.put_u8(self.landed_state as u8);
15012 __tmp.put_i8(self.throttle);
15013 __tmp.put_u8(self.airspeed);
15014 __tmp.put_u8(self.airspeed_sp);
15015 __tmp.put_u8(self.groundspeed);
15016 __tmp.put_i8(self.climb_rate);
15017 __tmp.put_u8(self.gps_nsat);
15018 __tmp.put_u8(self.gps_fix_type as u8);
15019 __tmp.put_u8(self.battery_remaining);
15020 __tmp.put_i8(self.temperature);
15021 __tmp.put_i8(self.temperature_air);
15022 __tmp.put_u8(self.failsafe);
15023 __tmp.put_u8(self.wp_num);
15024 if matches!(version, MavlinkVersion::V2) {
15025 let len = __tmp.len();
15026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15027 } else {
15028 __tmp.len()
15029 }
15030 }
15031}
15032#[doc = "id: 235"]
15033#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15034#[derive(Debug, Clone, PartialEq)]
15035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15037pub struct HIGH_LATENCY2_DATA {
15038 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15039 pub timestamp: u32,
15040 #[doc = "Latitude"]
15041 pub latitude: i32,
15042 #[doc = "Longitude"]
15043 pub longitude: i32,
15044 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15045 pub custom_mode: u16,
15046 #[doc = "Altitude above mean sea level"]
15047 pub altitude: i16,
15048 #[doc = "Altitude setpoint"]
15049 pub target_altitude: i16,
15050 #[doc = "Distance to target waypoint or position"]
15051 pub target_distance: u16,
15052 #[doc = "Current waypoint number"]
15053 pub wp_num: u16,
15054 #[doc = "Bitmap of failure flags."]
15055 pub failure_flags: HlFailureFlag,
15056 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15057 pub mavtype: MavType,
15058 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15059 pub autopilot: MavAutopilot,
15060 #[doc = "Heading"]
15061 pub heading: u8,
15062 #[doc = "Heading setpoint"]
15063 pub target_heading: u8,
15064 #[doc = "Throttle"]
15065 pub throttle: u8,
15066 #[doc = "Airspeed"]
15067 pub airspeed: u8,
15068 #[doc = "Airspeed setpoint"]
15069 pub airspeed_sp: u8,
15070 #[doc = "Groundspeed"]
15071 pub groundspeed: u8,
15072 #[doc = "Windspeed"]
15073 pub windspeed: u8,
15074 #[doc = "Wind heading"]
15075 pub wind_heading: u8,
15076 #[doc = "Maximum error horizontal position since last message"]
15077 pub eph: u8,
15078 #[doc = "Maximum error vertical position since last message"]
15079 pub epv: u8,
15080 #[doc = "Air temperature"]
15081 pub temperature_air: i8,
15082 #[doc = "Maximum climb rate magnitude since last message"]
15083 pub climb_rate: i8,
15084 #[doc = "Battery level (-1 if field not provided)."]
15085 pub battery: i8,
15086 #[doc = "Field for custom payload."]
15087 pub custom0: i8,
15088 #[doc = "Field for custom payload."]
15089 pub custom1: i8,
15090 #[doc = "Field for custom payload."]
15091 pub custom2: i8,
15092}
15093impl HIGH_LATENCY2_DATA {
15094 pub const ENCODED_LEN: usize = 42usize;
15095 pub const DEFAULT: Self = Self {
15096 timestamp: 0_u32,
15097 latitude: 0_i32,
15098 longitude: 0_i32,
15099 custom_mode: 0_u16,
15100 altitude: 0_i16,
15101 target_altitude: 0_i16,
15102 target_distance: 0_u16,
15103 wp_num: 0_u16,
15104 failure_flags: HlFailureFlag::DEFAULT,
15105 mavtype: MavType::DEFAULT,
15106 autopilot: MavAutopilot::DEFAULT,
15107 heading: 0_u8,
15108 target_heading: 0_u8,
15109 throttle: 0_u8,
15110 airspeed: 0_u8,
15111 airspeed_sp: 0_u8,
15112 groundspeed: 0_u8,
15113 windspeed: 0_u8,
15114 wind_heading: 0_u8,
15115 eph: 0_u8,
15116 epv: 0_u8,
15117 temperature_air: 0_i8,
15118 climb_rate: 0_i8,
15119 battery: 0_i8,
15120 custom0: 0_i8,
15121 custom1: 0_i8,
15122 custom2: 0_i8,
15123 };
15124 #[cfg(feature = "arbitrary")]
15125 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15126 use arbitrary::{Arbitrary, Unstructured};
15127 let mut buf = [0u8; 1024];
15128 rng.fill_bytes(&mut buf);
15129 let mut unstructured = Unstructured::new(&buf);
15130 Self::arbitrary(&mut unstructured).unwrap_or_default()
15131 }
15132}
15133impl Default for HIGH_LATENCY2_DATA {
15134 fn default() -> Self {
15135 Self::DEFAULT.clone()
15136 }
15137}
15138impl MessageData for HIGH_LATENCY2_DATA {
15139 type Message = MavMessage;
15140 const ID: u32 = 235u32;
15141 const NAME: &'static str = "HIGH_LATENCY2";
15142 const EXTRA_CRC: u8 = 179u8;
15143 const ENCODED_LEN: usize = 42usize;
15144 fn deser(
15145 _version: MavlinkVersion,
15146 __input: &[u8],
15147 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15148 let avail_len = __input.len();
15149 let mut payload_buf = [0; Self::ENCODED_LEN];
15150 let mut buf = if avail_len < Self::ENCODED_LEN {
15151 payload_buf[0..avail_len].copy_from_slice(__input);
15152 Bytes::new(&payload_buf)
15153 } else {
15154 Bytes::new(__input)
15155 };
15156 let mut __struct = Self::default();
15157 __struct.timestamp = buf.get_u32_le();
15158 __struct.latitude = buf.get_i32_le();
15159 __struct.longitude = buf.get_i32_le();
15160 __struct.custom_mode = buf.get_u16_le();
15161 __struct.altitude = buf.get_i16_le();
15162 __struct.target_altitude = buf.get_i16_le();
15163 __struct.target_distance = buf.get_u16_le();
15164 __struct.wp_num = buf.get_u16_le();
15165 let tmp = buf.get_u16_le();
15166 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15167 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15168 flag_type: "HlFailureFlag",
15169 value: tmp as u32,
15170 })?;
15171 let tmp = buf.get_u8();
15172 __struct.mavtype =
15173 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15174 enum_type: "MavType",
15175 value: tmp as u32,
15176 })?;
15177 let tmp = buf.get_u8();
15178 __struct.autopilot =
15179 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15180 enum_type: "MavAutopilot",
15181 value: tmp as u32,
15182 })?;
15183 __struct.heading = buf.get_u8();
15184 __struct.target_heading = buf.get_u8();
15185 __struct.throttle = buf.get_u8();
15186 __struct.airspeed = buf.get_u8();
15187 __struct.airspeed_sp = buf.get_u8();
15188 __struct.groundspeed = buf.get_u8();
15189 __struct.windspeed = buf.get_u8();
15190 __struct.wind_heading = buf.get_u8();
15191 __struct.eph = buf.get_u8();
15192 __struct.epv = buf.get_u8();
15193 __struct.temperature_air = buf.get_i8();
15194 __struct.climb_rate = buf.get_i8();
15195 __struct.battery = buf.get_i8();
15196 __struct.custom0 = buf.get_i8();
15197 __struct.custom1 = buf.get_i8();
15198 __struct.custom2 = buf.get_i8();
15199 Ok(__struct)
15200 }
15201 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15202 let mut __tmp = BytesMut::new(bytes);
15203 #[allow(clippy::absurd_extreme_comparisons)]
15204 #[allow(unused_comparisons)]
15205 if __tmp.remaining() < Self::ENCODED_LEN {
15206 panic!(
15207 "buffer is too small (need {} bytes, but got {})",
15208 Self::ENCODED_LEN,
15209 __tmp.remaining(),
15210 )
15211 }
15212 __tmp.put_u32_le(self.timestamp);
15213 __tmp.put_i32_le(self.latitude);
15214 __tmp.put_i32_le(self.longitude);
15215 __tmp.put_u16_le(self.custom_mode);
15216 __tmp.put_i16_le(self.altitude);
15217 __tmp.put_i16_le(self.target_altitude);
15218 __tmp.put_u16_le(self.target_distance);
15219 __tmp.put_u16_le(self.wp_num);
15220 __tmp.put_u16_le(self.failure_flags.bits());
15221 __tmp.put_u8(self.mavtype as u8);
15222 __tmp.put_u8(self.autopilot as u8);
15223 __tmp.put_u8(self.heading);
15224 __tmp.put_u8(self.target_heading);
15225 __tmp.put_u8(self.throttle);
15226 __tmp.put_u8(self.airspeed);
15227 __tmp.put_u8(self.airspeed_sp);
15228 __tmp.put_u8(self.groundspeed);
15229 __tmp.put_u8(self.windspeed);
15230 __tmp.put_u8(self.wind_heading);
15231 __tmp.put_u8(self.eph);
15232 __tmp.put_u8(self.epv);
15233 __tmp.put_i8(self.temperature_air);
15234 __tmp.put_i8(self.climb_rate);
15235 __tmp.put_i8(self.battery);
15236 __tmp.put_i8(self.custom0);
15237 __tmp.put_i8(self.custom1);
15238 __tmp.put_i8(self.custom2);
15239 if matches!(version, MavlinkVersion::V2) {
15240 let len = __tmp.len();
15241 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15242 } else {
15243 __tmp.len()
15244 }
15245 }
15246}
15247#[doc = "id: 93"]
15248#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15249#[derive(Debug, Clone, PartialEq)]
15250#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15252pub struct HIL_ACTUATOR_CONTROLS_DATA {
15253 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15254 pub time_usec: u64,
15255 #[doc = "Flags bitmask."]
15256 pub flags: HilActuatorControlsFlags,
15257 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15258 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15259 pub controls: [f32; 16],
15260 #[doc = "System mode. Includes arming state."]
15261 pub mode: MavModeFlag,
15262}
15263impl HIL_ACTUATOR_CONTROLS_DATA {
15264 pub const ENCODED_LEN: usize = 81usize;
15265 pub const DEFAULT: Self = Self {
15266 time_usec: 0_u64,
15267 flags: HilActuatorControlsFlags::DEFAULT,
15268 controls: [0.0_f32; 16usize],
15269 mode: MavModeFlag::DEFAULT,
15270 };
15271 #[cfg(feature = "arbitrary")]
15272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15273 use arbitrary::{Arbitrary, Unstructured};
15274 let mut buf = [0u8; 1024];
15275 rng.fill_bytes(&mut buf);
15276 let mut unstructured = Unstructured::new(&buf);
15277 Self::arbitrary(&mut unstructured).unwrap_or_default()
15278 }
15279}
15280impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15281 fn default() -> Self {
15282 Self::DEFAULT.clone()
15283 }
15284}
15285impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15286 type Message = MavMessage;
15287 const ID: u32 = 93u32;
15288 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15289 const EXTRA_CRC: u8 = 47u8;
15290 const ENCODED_LEN: usize = 81usize;
15291 fn deser(
15292 _version: MavlinkVersion,
15293 __input: &[u8],
15294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15295 let avail_len = __input.len();
15296 let mut payload_buf = [0; Self::ENCODED_LEN];
15297 let mut buf = if avail_len < Self::ENCODED_LEN {
15298 payload_buf[0..avail_len].copy_from_slice(__input);
15299 Bytes::new(&payload_buf)
15300 } else {
15301 Bytes::new(__input)
15302 };
15303 let mut __struct = Self::default();
15304 __struct.time_usec = buf.get_u64_le();
15305 let tmp = buf.get_u64_le();
15306 __struct.flags =
15307 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15308 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15309 flag_type: "HilActuatorControlsFlags",
15310 value: tmp as u32,
15311 })?;
15312 for v in &mut __struct.controls {
15313 let val = buf.get_f32_le();
15314 *v = val;
15315 }
15316 let tmp = buf.get_u8();
15317 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15318 ::mavlink_core::error::ParserError::InvalidFlag {
15319 flag_type: "MavModeFlag",
15320 value: tmp as u32,
15321 },
15322 )?;
15323 Ok(__struct)
15324 }
15325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15326 let mut __tmp = BytesMut::new(bytes);
15327 #[allow(clippy::absurd_extreme_comparisons)]
15328 #[allow(unused_comparisons)]
15329 if __tmp.remaining() < Self::ENCODED_LEN {
15330 panic!(
15331 "buffer is too small (need {} bytes, but got {})",
15332 Self::ENCODED_LEN,
15333 __tmp.remaining(),
15334 )
15335 }
15336 __tmp.put_u64_le(self.time_usec);
15337 __tmp.put_u64_le(self.flags.bits());
15338 for val in &self.controls {
15339 __tmp.put_f32_le(*val);
15340 }
15341 __tmp.put_u8(self.mode.bits());
15342 if matches!(version, MavlinkVersion::V2) {
15343 let len = __tmp.len();
15344 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15345 } else {
15346 __tmp.len()
15347 }
15348 }
15349}
15350#[doc = "id: 91"]
15351#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15352#[derive(Debug, Clone, PartialEq)]
15353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15355pub struct HIL_CONTROLS_DATA {
15356 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15357 pub time_usec: u64,
15358 #[doc = "Control output -1 .. 1"]
15359 pub roll_ailerons: f32,
15360 #[doc = "Control output -1 .. 1"]
15361 pub pitch_elevator: f32,
15362 #[doc = "Control output -1 .. 1"]
15363 pub yaw_rudder: f32,
15364 #[doc = "Throttle 0 .. 1"]
15365 pub throttle: f32,
15366 #[doc = "Aux 1, -1 .. 1"]
15367 pub aux1: f32,
15368 #[doc = "Aux 2, -1 .. 1"]
15369 pub aux2: f32,
15370 #[doc = "Aux 3, -1 .. 1"]
15371 pub aux3: f32,
15372 #[doc = "Aux 4, -1 .. 1"]
15373 pub aux4: f32,
15374 #[doc = "System mode."]
15375 pub mode: MavMode,
15376 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15377 pub nav_mode: u8,
15378}
15379impl HIL_CONTROLS_DATA {
15380 pub const ENCODED_LEN: usize = 42usize;
15381 pub const DEFAULT: Self = Self {
15382 time_usec: 0_u64,
15383 roll_ailerons: 0.0_f32,
15384 pitch_elevator: 0.0_f32,
15385 yaw_rudder: 0.0_f32,
15386 throttle: 0.0_f32,
15387 aux1: 0.0_f32,
15388 aux2: 0.0_f32,
15389 aux3: 0.0_f32,
15390 aux4: 0.0_f32,
15391 mode: MavMode::DEFAULT,
15392 nav_mode: 0_u8,
15393 };
15394 #[cfg(feature = "arbitrary")]
15395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15396 use arbitrary::{Arbitrary, Unstructured};
15397 let mut buf = [0u8; 1024];
15398 rng.fill_bytes(&mut buf);
15399 let mut unstructured = Unstructured::new(&buf);
15400 Self::arbitrary(&mut unstructured).unwrap_or_default()
15401 }
15402}
15403impl Default for HIL_CONTROLS_DATA {
15404 fn default() -> Self {
15405 Self::DEFAULT.clone()
15406 }
15407}
15408impl MessageData for HIL_CONTROLS_DATA {
15409 type Message = MavMessage;
15410 const ID: u32 = 91u32;
15411 const NAME: &'static str = "HIL_CONTROLS";
15412 const EXTRA_CRC: u8 = 63u8;
15413 const ENCODED_LEN: usize = 42usize;
15414 fn deser(
15415 _version: MavlinkVersion,
15416 __input: &[u8],
15417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15418 let avail_len = __input.len();
15419 let mut payload_buf = [0; Self::ENCODED_LEN];
15420 let mut buf = if avail_len < Self::ENCODED_LEN {
15421 payload_buf[0..avail_len].copy_from_slice(__input);
15422 Bytes::new(&payload_buf)
15423 } else {
15424 Bytes::new(__input)
15425 };
15426 let mut __struct = Self::default();
15427 __struct.time_usec = buf.get_u64_le();
15428 __struct.roll_ailerons = buf.get_f32_le();
15429 __struct.pitch_elevator = buf.get_f32_le();
15430 __struct.yaw_rudder = buf.get_f32_le();
15431 __struct.throttle = buf.get_f32_le();
15432 __struct.aux1 = buf.get_f32_le();
15433 __struct.aux2 = buf.get_f32_le();
15434 __struct.aux3 = buf.get_f32_le();
15435 __struct.aux4 = buf.get_f32_le();
15436 let tmp = buf.get_u8();
15437 __struct.mode =
15438 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15439 enum_type: "MavMode",
15440 value: tmp as u32,
15441 })?;
15442 __struct.nav_mode = buf.get_u8();
15443 Ok(__struct)
15444 }
15445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15446 let mut __tmp = BytesMut::new(bytes);
15447 #[allow(clippy::absurd_extreme_comparisons)]
15448 #[allow(unused_comparisons)]
15449 if __tmp.remaining() < Self::ENCODED_LEN {
15450 panic!(
15451 "buffer is too small (need {} bytes, but got {})",
15452 Self::ENCODED_LEN,
15453 __tmp.remaining(),
15454 )
15455 }
15456 __tmp.put_u64_le(self.time_usec);
15457 __tmp.put_f32_le(self.roll_ailerons);
15458 __tmp.put_f32_le(self.pitch_elevator);
15459 __tmp.put_f32_le(self.yaw_rudder);
15460 __tmp.put_f32_le(self.throttle);
15461 __tmp.put_f32_le(self.aux1);
15462 __tmp.put_f32_le(self.aux2);
15463 __tmp.put_f32_le(self.aux3);
15464 __tmp.put_f32_le(self.aux4);
15465 __tmp.put_u8(self.mode as u8);
15466 __tmp.put_u8(self.nav_mode);
15467 if matches!(version, MavlinkVersion::V2) {
15468 let len = __tmp.len();
15469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15470 } else {
15471 __tmp.len()
15472 }
15473 }
15474}
15475#[doc = "id: 113"]
15476#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15477#[derive(Debug, Clone, PartialEq)]
15478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15480pub struct HIL_GPS_DATA {
15481 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15482 pub time_usec: u64,
15483 #[doc = "Latitude (WGS84)"]
15484 pub lat: i32,
15485 #[doc = "Longitude (WGS84)"]
15486 pub lon: i32,
15487 #[doc = "Altitude (MSL). Positive for up."]
15488 pub alt: i32,
15489 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15490 pub eph: u16,
15491 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15492 pub epv: u16,
15493 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15494 pub vel: u16,
15495 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15496 pub vn: i16,
15497 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15498 pub ve: i16,
15499 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15500 pub vd: i16,
15501 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15502 pub cog: u16,
15503 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15504 pub fix_type: u8,
15505 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15506 pub satellites_visible: u8,
15507 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15508 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15509 pub id: u8,
15510 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15511 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15512 pub yaw: u16,
15513}
15514impl HIL_GPS_DATA {
15515 pub const ENCODED_LEN: usize = 39usize;
15516 pub const DEFAULT: Self = Self {
15517 time_usec: 0_u64,
15518 lat: 0_i32,
15519 lon: 0_i32,
15520 alt: 0_i32,
15521 eph: 0_u16,
15522 epv: 0_u16,
15523 vel: 0_u16,
15524 vn: 0_i16,
15525 ve: 0_i16,
15526 vd: 0_i16,
15527 cog: 0_u16,
15528 fix_type: 0_u8,
15529 satellites_visible: 0_u8,
15530 id: 0_u8,
15531 yaw: 0_u16,
15532 };
15533 #[cfg(feature = "arbitrary")]
15534 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15535 use arbitrary::{Arbitrary, Unstructured};
15536 let mut buf = [0u8; 1024];
15537 rng.fill_bytes(&mut buf);
15538 let mut unstructured = Unstructured::new(&buf);
15539 Self::arbitrary(&mut unstructured).unwrap_or_default()
15540 }
15541}
15542impl Default for HIL_GPS_DATA {
15543 fn default() -> Self {
15544 Self::DEFAULT.clone()
15545 }
15546}
15547impl MessageData for HIL_GPS_DATA {
15548 type Message = MavMessage;
15549 const ID: u32 = 113u32;
15550 const NAME: &'static str = "HIL_GPS";
15551 const EXTRA_CRC: u8 = 124u8;
15552 const ENCODED_LEN: usize = 39usize;
15553 fn deser(
15554 _version: MavlinkVersion,
15555 __input: &[u8],
15556 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15557 let avail_len = __input.len();
15558 let mut payload_buf = [0; Self::ENCODED_LEN];
15559 let mut buf = if avail_len < Self::ENCODED_LEN {
15560 payload_buf[0..avail_len].copy_from_slice(__input);
15561 Bytes::new(&payload_buf)
15562 } else {
15563 Bytes::new(__input)
15564 };
15565 let mut __struct = Self::default();
15566 __struct.time_usec = buf.get_u64_le();
15567 __struct.lat = buf.get_i32_le();
15568 __struct.lon = buf.get_i32_le();
15569 __struct.alt = buf.get_i32_le();
15570 __struct.eph = buf.get_u16_le();
15571 __struct.epv = buf.get_u16_le();
15572 __struct.vel = buf.get_u16_le();
15573 __struct.vn = buf.get_i16_le();
15574 __struct.ve = buf.get_i16_le();
15575 __struct.vd = buf.get_i16_le();
15576 __struct.cog = buf.get_u16_le();
15577 __struct.fix_type = buf.get_u8();
15578 __struct.satellites_visible = buf.get_u8();
15579 __struct.id = buf.get_u8();
15580 __struct.yaw = buf.get_u16_le();
15581 Ok(__struct)
15582 }
15583 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15584 let mut __tmp = BytesMut::new(bytes);
15585 #[allow(clippy::absurd_extreme_comparisons)]
15586 #[allow(unused_comparisons)]
15587 if __tmp.remaining() < Self::ENCODED_LEN {
15588 panic!(
15589 "buffer is too small (need {} bytes, but got {})",
15590 Self::ENCODED_LEN,
15591 __tmp.remaining(),
15592 )
15593 }
15594 __tmp.put_u64_le(self.time_usec);
15595 __tmp.put_i32_le(self.lat);
15596 __tmp.put_i32_le(self.lon);
15597 __tmp.put_i32_le(self.alt);
15598 __tmp.put_u16_le(self.eph);
15599 __tmp.put_u16_le(self.epv);
15600 __tmp.put_u16_le(self.vel);
15601 __tmp.put_i16_le(self.vn);
15602 __tmp.put_i16_le(self.ve);
15603 __tmp.put_i16_le(self.vd);
15604 __tmp.put_u16_le(self.cog);
15605 __tmp.put_u8(self.fix_type);
15606 __tmp.put_u8(self.satellites_visible);
15607 __tmp.put_u8(self.id);
15608 __tmp.put_u16_le(self.yaw);
15609 if matches!(version, MavlinkVersion::V2) {
15610 let len = __tmp.len();
15611 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15612 } else {
15613 __tmp.len()
15614 }
15615 }
15616}
15617#[doc = "id: 114"]
15618#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15619#[derive(Debug, Clone, PartialEq)]
15620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15622pub struct HIL_OPTICAL_FLOW_DATA {
15623 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15624 pub time_usec: u64,
15625 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15626 pub integration_time_us: u32,
15627 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15628 pub integrated_x: f32,
15629 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15630 pub integrated_y: f32,
15631 #[doc = "RH rotation around X axis"]
15632 pub integrated_xgyro: f32,
15633 #[doc = "RH rotation around Y axis"]
15634 pub integrated_ygyro: f32,
15635 #[doc = "RH rotation around Z axis"]
15636 pub integrated_zgyro: f32,
15637 #[doc = "Time since the distance was sampled."]
15638 pub time_delta_distance_us: u32,
15639 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15640 pub distance: f32,
15641 #[doc = "Temperature"]
15642 pub temperature: i16,
15643 #[doc = "Sensor ID"]
15644 pub sensor_id: u8,
15645 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15646 pub quality: u8,
15647}
15648impl HIL_OPTICAL_FLOW_DATA {
15649 pub const ENCODED_LEN: usize = 44usize;
15650 pub const DEFAULT: Self = Self {
15651 time_usec: 0_u64,
15652 integration_time_us: 0_u32,
15653 integrated_x: 0.0_f32,
15654 integrated_y: 0.0_f32,
15655 integrated_xgyro: 0.0_f32,
15656 integrated_ygyro: 0.0_f32,
15657 integrated_zgyro: 0.0_f32,
15658 time_delta_distance_us: 0_u32,
15659 distance: 0.0_f32,
15660 temperature: 0_i16,
15661 sensor_id: 0_u8,
15662 quality: 0_u8,
15663 };
15664 #[cfg(feature = "arbitrary")]
15665 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15666 use arbitrary::{Arbitrary, Unstructured};
15667 let mut buf = [0u8; 1024];
15668 rng.fill_bytes(&mut buf);
15669 let mut unstructured = Unstructured::new(&buf);
15670 Self::arbitrary(&mut unstructured).unwrap_or_default()
15671 }
15672}
15673impl Default for HIL_OPTICAL_FLOW_DATA {
15674 fn default() -> Self {
15675 Self::DEFAULT.clone()
15676 }
15677}
15678impl MessageData for HIL_OPTICAL_FLOW_DATA {
15679 type Message = MavMessage;
15680 const ID: u32 = 114u32;
15681 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15682 const EXTRA_CRC: u8 = 237u8;
15683 const ENCODED_LEN: usize = 44usize;
15684 fn deser(
15685 _version: MavlinkVersion,
15686 __input: &[u8],
15687 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15688 let avail_len = __input.len();
15689 let mut payload_buf = [0; Self::ENCODED_LEN];
15690 let mut buf = if avail_len < Self::ENCODED_LEN {
15691 payload_buf[0..avail_len].copy_from_slice(__input);
15692 Bytes::new(&payload_buf)
15693 } else {
15694 Bytes::new(__input)
15695 };
15696 let mut __struct = Self::default();
15697 __struct.time_usec = buf.get_u64_le();
15698 __struct.integration_time_us = buf.get_u32_le();
15699 __struct.integrated_x = buf.get_f32_le();
15700 __struct.integrated_y = buf.get_f32_le();
15701 __struct.integrated_xgyro = buf.get_f32_le();
15702 __struct.integrated_ygyro = buf.get_f32_le();
15703 __struct.integrated_zgyro = buf.get_f32_le();
15704 __struct.time_delta_distance_us = buf.get_u32_le();
15705 __struct.distance = buf.get_f32_le();
15706 __struct.temperature = buf.get_i16_le();
15707 __struct.sensor_id = buf.get_u8();
15708 __struct.quality = buf.get_u8();
15709 Ok(__struct)
15710 }
15711 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15712 let mut __tmp = BytesMut::new(bytes);
15713 #[allow(clippy::absurd_extreme_comparisons)]
15714 #[allow(unused_comparisons)]
15715 if __tmp.remaining() < Self::ENCODED_LEN {
15716 panic!(
15717 "buffer is too small (need {} bytes, but got {})",
15718 Self::ENCODED_LEN,
15719 __tmp.remaining(),
15720 )
15721 }
15722 __tmp.put_u64_le(self.time_usec);
15723 __tmp.put_u32_le(self.integration_time_us);
15724 __tmp.put_f32_le(self.integrated_x);
15725 __tmp.put_f32_le(self.integrated_y);
15726 __tmp.put_f32_le(self.integrated_xgyro);
15727 __tmp.put_f32_le(self.integrated_ygyro);
15728 __tmp.put_f32_le(self.integrated_zgyro);
15729 __tmp.put_u32_le(self.time_delta_distance_us);
15730 __tmp.put_f32_le(self.distance);
15731 __tmp.put_i16_le(self.temperature);
15732 __tmp.put_u8(self.sensor_id);
15733 __tmp.put_u8(self.quality);
15734 if matches!(version, MavlinkVersion::V2) {
15735 let len = __tmp.len();
15736 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15737 } else {
15738 __tmp.len()
15739 }
15740 }
15741}
15742#[doc = "id: 92"]
15743#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15744#[derive(Debug, Clone, PartialEq)]
15745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15747pub struct HIL_RC_INPUTS_RAW_DATA {
15748 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15749 pub time_usec: u64,
15750 #[doc = "RC channel 1 value"]
15751 pub chan1_raw: u16,
15752 #[doc = "RC channel 2 value"]
15753 pub chan2_raw: u16,
15754 #[doc = "RC channel 3 value"]
15755 pub chan3_raw: u16,
15756 #[doc = "RC channel 4 value"]
15757 pub chan4_raw: u16,
15758 #[doc = "RC channel 5 value"]
15759 pub chan5_raw: u16,
15760 #[doc = "RC channel 6 value"]
15761 pub chan6_raw: u16,
15762 #[doc = "RC channel 7 value"]
15763 pub chan7_raw: u16,
15764 #[doc = "RC channel 8 value"]
15765 pub chan8_raw: u16,
15766 #[doc = "RC channel 9 value"]
15767 pub chan9_raw: u16,
15768 #[doc = "RC channel 10 value"]
15769 pub chan10_raw: u16,
15770 #[doc = "RC channel 11 value"]
15771 pub chan11_raw: u16,
15772 #[doc = "RC channel 12 value"]
15773 pub chan12_raw: u16,
15774 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
15775 pub rssi: u8,
15776}
15777impl HIL_RC_INPUTS_RAW_DATA {
15778 pub const ENCODED_LEN: usize = 33usize;
15779 pub const DEFAULT: Self = Self {
15780 time_usec: 0_u64,
15781 chan1_raw: 0_u16,
15782 chan2_raw: 0_u16,
15783 chan3_raw: 0_u16,
15784 chan4_raw: 0_u16,
15785 chan5_raw: 0_u16,
15786 chan6_raw: 0_u16,
15787 chan7_raw: 0_u16,
15788 chan8_raw: 0_u16,
15789 chan9_raw: 0_u16,
15790 chan10_raw: 0_u16,
15791 chan11_raw: 0_u16,
15792 chan12_raw: 0_u16,
15793 rssi: 0_u8,
15794 };
15795 #[cfg(feature = "arbitrary")]
15796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15797 use arbitrary::{Arbitrary, Unstructured};
15798 let mut buf = [0u8; 1024];
15799 rng.fill_bytes(&mut buf);
15800 let mut unstructured = Unstructured::new(&buf);
15801 Self::arbitrary(&mut unstructured).unwrap_or_default()
15802 }
15803}
15804impl Default for HIL_RC_INPUTS_RAW_DATA {
15805 fn default() -> Self {
15806 Self::DEFAULT.clone()
15807 }
15808}
15809impl MessageData for HIL_RC_INPUTS_RAW_DATA {
15810 type Message = MavMessage;
15811 const ID: u32 = 92u32;
15812 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
15813 const EXTRA_CRC: u8 = 54u8;
15814 const ENCODED_LEN: usize = 33usize;
15815 fn deser(
15816 _version: MavlinkVersion,
15817 __input: &[u8],
15818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15819 let avail_len = __input.len();
15820 let mut payload_buf = [0; Self::ENCODED_LEN];
15821 let mut buf = if avail_len < Self::ENCODED_LEN {
15822 payload_buf[0..avail_len].copy_from_slice(__input);
15823 Bytes::new(&payload_buf)
15824 } else {
15825 Bytes::new(__input)
15826 };
15827 let mut __struct = Self::default();
15828 __struct.time_usec = buf.get_u64_le();
15829 __struct.chan1_raw = buf.get_u16_le();
15830 __struct.chan2_raw = buf.get_u16_le();
15831 __struct.chan3_raw = buf.get_u16_le();
15832 __struct.chan4_raw = buf.get_u16_le();
15833 __struct.chan5_raw = buf.get_u16_le();
15834 __struct.chan6_raw = buf.get_u16_le();
15835 __struct.chan7_raw = buf.get_u16_le();
15836 __struct.chan8_raw = buf.get_u16_le();
15837 __struct.chan9_raw = buf.get_u16_le();
15838 __struct.chan10_raw = buf.get_u16_le();
15839 __struct.chan11_raw = buf.get_u16_le();
15840 __struct.chan12_raw = buf.get_u16_le();
15841 __struct.rssi = buf.get_u8();
15842 Ok(__struct)
15843 }
15844 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15845 let mut __tmp = BytesMut::new(bytes);
15846 #[allow(clippy::absurd_extreme_comparisons)]
15847 #[allow(unused_comparisons)]
15848 if __tmp.remaining() < Self::ENCODED_LEN {
15849 panic!(
15850 "buffer is too small (need {} bytes, but got {})",
15851 Self::ENCODED_LEN,
15852 __tmp.remaining(),
15853 )
15854 }
15855 __tmp.put_u64_le(self.time_usec);
15856 __tmp.put_u16_le(self.chan1_raw);
15857 __tmp.put_u16_le(self.chan2_raw);
15858 __tmp.put_u16_le(self.chan3_raw);
15859 __tmp.put_u16_le(self.chan4_raw);
15860 __tmp.put_u16_le(self.chan5_raw);
15861 __tmp.put_u16_le(self.chan6_raw);
15862 __tmp.put_u16_le(self.chan7_raw);
15863 __tmp.put_u16_le(self.chan8_raw);
15864 __tmp.put_u16_le(self.chan9_raw);
15865 __tmp.put_u16_le(self.chan10_raw);
15866 __tmp.put_u16_le(self.chan11_raw);
15867 __tmp.put_u16_le(self.chan12_raw);
15868 __tmp.put_u8(self.rssi);
15869 if matches!(version, MavlinkVersion::V2) {
15870 let len = __tmp.len();
15871 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15872 } else {
15873 __tmp.len()
15874 }
15875 }
15876}
15877#[doc = "id: 107"]
15878#[doc = "The IMU readings in SI units in NED body frame."]
15879#[derive(Debug, Clone, PartialEq)]
15880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15882pub struct HIL_SENSOR_DATA {
15883 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15884 pub time_usec: u64,
15885 #[doc = "X acceleration"]
15886 pub xacc: f32,
15887 #[doc = "Y acceleration"]
15888 pub yacc: f32,
15889 #[doc = "Z acceleration"]
15890 pub zacc: f32,
15891 #[doc = "Angular speed around X axis in body frame"]
15892 pub xgyro: f32,
15893 #[doc = "Angular speed around Y axis in body frame"]
15894 pub ygyro: f32,
15895 #[doc = "Angular speed around Z axis in body frame"]
15896 pub zgyro: f32,
15897 #[doc = "X Magnetic field"]
15898 pub xmag: f32,
15899 #[doc = "Y Magnetic field"]
15900 pub ymag: f32,
15901 #[doc = "Z Magnetic field"]
15902 pub zmag: f32,
15903 #[doc = "Absolute pressure"]
15904 pub abs_pressure: f32,
15905 #[doc = "Differential pressure (airspeed)"]
15906 pub diff_pressure: f32,
15907 #[doc = "Altitude calculated from pressure"]
15908 pub pressure_alt: f32,
15909 #[doc = "Temperature"]
15910 pub temperature: f32,
15911 #[doc = "Bitmap for fields that have updated since last message"]
15912 pub fields_updated: HilSensorUpdatedFlags,
15913 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
15914 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15915 pub id: u8,
15916}
15917impl HIL_SENSOR_DATA {
15918 pub const ENCODED_LEN: usize = 65usize;
15919 pub const DEFAULT: Self = Self {
15920 time_usec: 0_u64,
15921 xacc: 0.0_f32,
15922 yacc: 0.0_f32,
15923 zacc: 0.0_f32,
15924 xgyro: 0.0_f32,
15925 ygyro: 0.0_f32,
15926 zgyro: 0.0_f32,
15927 xmag: 0.0_f32,
15928 ymag: 0.0_f32,
15929 zmag: 0.0_f32,
15930 abs_pressure: 0.0_f32,
15931 diff_pressure: 0.0_f32,
15932 pressure_alt: 0.0_f32,
15933 temperature: 0.0_f32,
15934 fields_updated: HilSensorUpdatedFlags::DEFAULT,
15935 id: 0_u8,
15936 };
15937 #[cfg(feature = "arbitrary")]
15938 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15939 use arbitrary::{Arbitrary, Unstructured};
15940 let mut buf = [0u8; 1024];
15941 rng.fill_bytes(&mut buf);
15942 let mut unstructured = Unstructured::new(&buf);
15943 Self::arbitrary(&mut unstructured).unwrap_or_default()
15944 }
15945}
15946impl Default for HIL_SENSOR_DATA {
15947 fn default() -> Self {
15948 Self::DEFAULT.clone()
15949 }
15950}
15951impl MessageData for HIL_SENSOR_DATA {
15952 type Message = MavMessage;
15953 const ID: u32 = 107u32;
15954 const NAME: &'static str = "HIL_SENSOR";
15955 const EXTRA_CRC: u8 = 108u8;
15956 const ENCODED_LEN: usize = 65usize;
15957 fn deser(
15958 _version: MavlinkVersion,
15959 __input: &[u8],
15960 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15961 let avail_len = __input.len();
15962 let mut payload_buf = [0; Self::ENCODED_LEN];
15963 let mut buf = if avail_len < Self::ENCODED_LEN {
15964 payload_buf[0..avail_len].copy_from_slice(__input);
15965 Bytes::new(&payload_buf)
15966 } else {
15967 Bytes::new(__input)
15968 };
15969 let mut __struct = Self::default();
15970 __struct.time_usec = buf.get_u64_le();
15971 __struct.xacc = buf.get_f32_le();
15972 __struct.yacc = buf.get_f32_le();
15973 __struct.zacc = buf.get_f32_le();
15974 __struct.xgyro = buf.get_f32_le();
15975 __struct.ygyro = buf.get_f32_le();
15976 __struct.zgyro = buf.get_f32_le();
15977 __struct.xmag = buf.get_f32_le();
15978 __struct.ymag = buf.get_f32_le();
15979 __struct.zmag = buf.get_f32_le();
15980 __struct.abs_pressure = buf.get_f32_le();
15981 __struct.diff_pressure = buf.get_f32_le();
15982 __struct.pressure_alt = buf.get_f32_le();
15983 __struct.temperature = buf.get_f32_le();
15984 let tmp = buf.get_u32_le();
15985 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
15986 tmp & HilSensorUpdatedFlags::all().bits(),
15987 )
15988 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15989 flag_type: "HilSensorUpdatedFlags",
15990 value: tmp as u32,
15991 })?;
15992 __struct.id = buf.get_u8();
15993 Ok(__struct)
15994 }
15995 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15996 let mut __tmp = BytesMut::new(bytes);
15997 #[allow(clippy::absurd_extreme_comparisons)]
15998 #[allow(unused_comparisons)]
15999 if __tmp.remaining() < Self::ENCODED_LEN {
16000 panic!(
16001 "buffer is too small (need {} bytes, but got {})",
16002 Self::ENCODED_LEN,
16003 __tmp.remaining(),
16004 )
16005 }
16006 __tmp.put_u64_le(self.time_usec);
16007 __tmp.put_f32_le(self.xacc);
16008 __tmp.put_f32_le(self.yacc);
16009 __tmp.put_f32_le(self.zacc);
16010 __tmp.put_f32_le(self.xgyro);
16011 __tmp.put_f32_le(self.ygyro);
16012 __tmp.put_f32_le(self.zgyro);
16013 __tmp.put_f32_le(self.xmag);
16014 __tmp.put_f32_le(self.ymag);
16015 __tmp.put_f32_le(self.zmag);
16016 __tmp.put_f32_le(self.abs_pressure);
16017 __tmp.put_f32_le(self.diff_pressure);
16018 __tmp.put_f32_le(self.pressure_alt);
16019 __tmp.put_f32_le(self.temperature);
16020 __tmp.put_u32_le(self.fields_updated.bits());
16021 __tmp.put_u8(self.id);
16022 if matches!(version, MavlinkVersion::V2) {
16023 let len = __tmp.len();
16024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16025 } else {
16026 __tmp.len()
16027 }
16028 }
16029}
16030#[doc = "id: 90"]
16031#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16032#[derive(Debug, Clone, PartialEq)]
16033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16035pub struct HIL_STATE_DATA {
16036 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16037 pub time_usec: u64,
16038 #[doc = "Roll angle"]
16039 pub roll: f32,
16040 #[doc = "Pitch angle"]
16041 pub pitch: f32,
16042 #[doc = "Yaw angle"]
16043 pub yaw: f32,
16044 #[doc = "Body frame roll / phi angular speed"]
16045 pub rollspeed: f32,
16046 #[doc = "Body frame pitch / theta angular speed"]
16047 pub pitchspeed: f32,
16048 #[doc = "Body frame yaw / psi angular speed"]
16049 pub yawspeed: f32,
16050 #[doc = "Latitude"]
16051 pub lat: i32,
16052 #[doc = "Longitude"]
16053 pub lon: i32,
16054 #[doc = "Altitude"]
16055 pub alt: i32,
16056 #[doc = "Ground X Speed (Latitude)"]
16057 pub vx: i16,
16058 #[doc = "Ground Y Speed (Longitude)"]
16059 pub vy: i16,
16060 #[doc = "Ground Z Speed (Altitude)"]
16061 pub vz: i16,
16062 #[doc = "X acceleration"]
16063 pub xacc: i16,
16064 #[doc = "Y acceleration"]
16065 pub yacc: i16,
16066 #[doc = "Z acceleration"]
16067 pub zacc: i16,
16068}
16069impl HIL_STATE_DATA {
16070 pub const ENCODED_LEN: usize = 56usize;
16071 pub const DEFAULT: Self = Self {
16072 time_usec: 0_u64,
16073 roll: 0.0_f32,
16074 pitch: 0.0_f32,
16075 yaw: 0.0_f32,
16076 rollspeed: 0.0_f32,
16077 pitchspeed: 0.0_f32,
16078 yawspeed: 0.0_f32,
16079 lat: 0_i32,
16080 lon: 0_i32,
16081 alt: 0_i32,
16082 vx: 0_i16,
16083 vy: 0_i16,
16084 vz: 0_i16,
16085 xacc: 0_i16,
16086 yacc: 0_i16,
16087 zacc: 0_i16,
16088 };
16089 #[cfg(feature = "arbitrary")]
16090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16091 use arbitrary::{Arbitrary, Unstructured};
16092 let mut buf = [0u8; 1024];
16093 rng.fill_bytes(&mut buf);
16094 let mut unstructured = Unstructured::new(&buf);
16095 Self::arbitrary(&mut unstructured).unwrap_or_default()
16096 }
16097}
16098impl Default for HIL_STATE_DATA {
16099 fn default() -> Self {
16100 Self::DEFAULT.clone()
16101 }
16102}
16103impl MessageData for HIL_STATE_DATA {
16104 type Message = MavMessage;
16105 const ID: u32 = 90u32;
16106 const NAME: &'static str = "HIL_STATE";
16107 const EXTRA_CRC: u8 = 183u8;
16108 const ENCODED_LEN: usize = 56usize;
16109 fn deser(
16110 _version: MavlinkVersion,
16111 __input: &[u8],
16112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16113 let avail_len = __input.len();
16114 let mut payload_buf = [0; Self::ENCODED_LEN];
16115 let mut buf = if avail_len < Self::ENCODED_LEN {
16116 payload_buf[0..avail_len].copy_from_slice(__input);
16117 Bytes::new(&payload_buf)
16118 } else {
16119 Bytes::new(__input)
16120 };
16121 let mut __struct = Self::default();
16122 __struct.time_usec = buf.get_u64_le();
16123 __struct.roll = buf.get_f32_le();
16124 __struct.pitch = buf.get_f32_le();
16125 __struct.yaw = buf.get_f32_le();
16126 __struct.rollspeed = buf.get_f32_le();
16127 __struct.pitchspeed = buf.get_f32_le();
16128 __struct.yawspeed = buf.get_f32_le();
16129 __struct.lat = buf.get_i32_le();
16130 __struct.lon = buf.get_i32_le();
16131 __struct.alt = buf.get_i32_le();
16132 __struct.vx = buf.get_i16_le();
16133 __struct.vy = buf.get_i16_le();
16134 __struct.vz = buf.get_i16_le();
16135 __struct.xacc = buf.get_i16_le();
16136 __struct.yacc = buf.get_i16_le();
16137 __struct.zacc = buf.get_i16_le();
16138 Ok(__struct)
16139 }
16140 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16141 let mut __tmp = BytesMut::new(bytes);
16142 #[allow(clippy::absurd_extreme_comparisons)]
16143 #[allow(unused_comparisons)]
16144 if __tmp.remaining() < Self::ENCODED_LEN {
16145 panic!(
16146 "buffer is too small (need {} bytes, but got {})",
16147 Self::ENCODED_LEN,
16148 __tmp.remaining(),
16149 )
16150 }
16151 __tmp.put_u64_le(self.time_usec);
16152 __tmp.put_f32_le(self.roll);
16153 __tmp.put_f32_le(self.pitch);
16154 __tmp.put_f32_le(self.yaw);
16155 __tmp.put_f32_le(self.rollspeed);
16156 __tmp.put_f32_le(self.pitchspeed);
16157 __tmp.put_f32_le(self.yawspeed);
16158 __tmp.put_i32_le(self.lat);
16159 __tmp.put_i32_le(self.lon);
16160 __tmp.put_i32_le(self.alt);
16161 __tmp.put_i16_le(self.vx);
16162 __tmp.put_i16_le(self.vy);
16163 __tmp.put_i16_le(self.vz);
16164 __tmp.put_i16_le(self.xacc);
16165 __tmp.put_i16_le(self.yacc);
16166 __tmp.put_i16_le(self.zacc);
16167 if matches!(version, MavlinkVersion::V2) {
16168 let len = __tmp.len();
16169 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16170 } else {
16171 __tmp.len()
16172 }
16173 }
16174}
16175#[doc = "id: 115"]
16176#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16177#[derive(Debug, Clone, PartialEq)]
16178#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16179#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16180pub struct HIL_STATE_QUATERNION_DATA {
16181 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16182 pub time_usec: u64,
16183 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16184 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16185 pub attitude_quaternion: [f32; 4],
16186 #[doc = "Body frame roll / phi angular speed"]
16187 pub rollspeed: f32,
16188 #[doc = "Body frame pitch / theta angular speed"]
16189 pub pitchspeed: f32,
16190 #[doc = "Body frame yaw / psi angular speed"]
16191 pub yawspeed: f32,
16192 #[doc = "Latitude"]
16193 pub lat: i32,
16194 #[doc = "Longitude"]
16195 pub lon: i32,
16196 #[doc = "Altitude"]
16197 pub alt: i32,
16198 #[doc = "Ground X Speed (Latitude)"]
16199 pub vx: i16,
16200 #[doc = "Ground Y Speed (Longitude)"]
16201 pub vy: i16,
16202 #[doc = "Ground Z Speed (Altitude)"]
16203 pub vz: i16,
16204 #[doc = "Indicated airspeed"]
16205 pub ind_airspeed: u16,
16206 #[doc = "True airspeed"]
16207 pub true_airspeed: u16,
16208 #[doc = "X acceleration"]
16209 pub xacc: i16,
16210 #[doc = "Y acceleration"]
16211 pub yacc: i16,
16212 #[doc = "Z acceleration"]
16213 pub zacc: i16,
16214}
16215impl HIL_STATE_QUATERNION_DATA {
16216 pub const ENCODED_LEN: usize = 64usize;
16217 pub const DEFAULT: Self = Self {
16218 time_usec: 0_u64,
16219 attitude_quaternion: [0.0_f32; 4usize],
16220 rollspeed: 0.0_f32,
16221 pitchspeed: 0.0_f32,
16222 yawspeed: 0.0_f32,
16223 lat: 0_i32,
16224 lon: 0_i32,
16225 alt: 0_i32,
16226 vx: 0_i16,
16227 vy: 0_i16,
16228 vz: 0_i16,
16229 ind_airspeed: 0_u16,
16230 true_airspeed: 0_u16,
16231 xacc: 0_i16,
16232 yacc: 0_i16,
16233 zacc: 0_i16,
16234 };
16235 #[cfg(feature = "arbitrary")]
16236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16237 use arbitrary::{Arbitrary, Unstructured};
16238 let mut buf = [0u8; 1024];
16239 rng.fill_bytes(&mut buf);
16240 let mut unstructured = Unstructured::new(&buf);
16241 Self::arbitrary(&mut unstructured).unwrap_or_default()
16242 }
16243}
16244impl Default for HIL_STATE_QUATERNION_DATA {
16245 fn default() -> Self {
16246 Self::DEFAULT.clone()
16247 }
16248}
16249impl MessageData for HIL_STATE_QUATERNION_DATA {
16250 type Message = MavMessage;
16251 const ID: u32 = 115u32;
16252 const NAME: &'static str = "HIL_STATE_QUATERNION";
16253 const EXTRA_CRC: u8 = 4u8;
16254 const ENCODED_LEN: usize = 64usize;
16255 fn deser(
16256 _version: MavlinkVersion,
16257 __input: &[u8],
16258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16259 let avail_len = __input.len();
16260 let mut payload_buf = [0; Self::ENCODED_LEN];
16261 let mut buf = if avail_len < Self::ENCODED_LEN {
16262 payload_buf[0..avail_len].copy_from_slice(__input);
16263 Bytes::new(&payload_buf)
16264 } else {
16265 Bytes::new(__input)
16266 };
16267 let mut __struct = Self::default();
16268 __struct.time_usec = buf.get_u64_le();
16269 for v in &mut __struct.attitude_quaternion {
16270 let val = buf.get_f32_le();
16271 *v = val;
16272 }
16273 __struct.rollspeed = buf.get_f32_le();
16274 __struct.pitchspeed = buf.get_f32_le();
16275 __struct.yawspeed = buf.get_f32_le();
16276 __struct.lat = buf.get_i32_le();
16277 __struct.lon = buf.get_i32_le();
16278 __struct.alt = buf.get_i32_le();
16279 __struct.vx = buf.get_i16_le();
16280 __struct.vy = buf.get_i16_le();
16281 __struct.vz = buf.get_i16_le();
16282 __struct.ind_airspeed = buf.get_u16_le();
16283 __struct.true_airspeed = buf.get_u16_le();
16284 __struct.xacc = buf.get_i16_le();
16285 __struct.yacc = buf.get_i16_le();
16286 __struct.zacc = buf.get_i16_le();
16287 Ok(__struct)
16288 }
16289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16290 let mut __tmp = BytesMut::new(bytes);
16291 #[allow(clippy::absurd_extreme_comparisons)]
16292 #[allow(unused_comparisons)]
16293 if __tmp.remaining() < Self::ENCODED_LEN {
16294 panic!(
16295 "buffer is too small (need {} bytes, but got {})",
16296 Self::ENCODED_LEN,
16297 __tmp.remaining(),
16298 )
16299 }
16300 __tmp.put_u64_le(self.time_usec);
16301 for val in &self.attitude_quaternion {
16302 __tmp.put_f32_le(*val);
16303 }
16304 __tmp.put_f32_le(self.rollspeed);
16305 __tmp.put_f32_le(self.pitchspeed);
16306 __tmp.put_f32_le(self.yawspeed);
16307 __tmp.put_i32_le(self.lat);
16308 __tmp.put_i32_le(self.lon);
16309 __tmp.put_i32_le(self.alt);
16310 __tmp.put_i16_le(self.vx);
16311 __tmp.put_i16_le(self.vy);
16312 __tmp.put_i16_le(self.vz);
16313 __tmp.put_u16_le(self.ind_airspeed);
16314 __tmp.put_u16_le(self.true_airspeed);
16315 __tmp.put_i16_le(self.xacc);
16316 __tmp.put_i16_le(self.yacc);
16317 __tmp.put_i16_le(self.zacc);
16318 if matches!(version, MavlinkVersion::V2) {
16319 let len = __tmp.len();
16320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16321 } else {
16322 __tmp.len()
16323 }
16324 }
16325}
16326#[doc = "id: 242"]
16327#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16328#[derive(Debug, Clone, PartialEq)]
16329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16331pub struct HOME_POSITION_DATA {
16332 #[doc = "Latitude (WGS84)"]
16333 pub latitude: i32,
16334 #[doc = "Longitude (WGS84)"]
16335 pub longitude: i32,
16336 #[doc = "Altitude (MSL). Positive for up."]
16337 pub altitude: i32,
16338 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16339 pub x: f32,
16340 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16341 pub y: f32,
16342 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16343 pub z: f32,
16344 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16345 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16346 pub q: [f32; 4],
16347 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16348 pub approach_x: f32,
16349 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16350 pub approach_y: f32,
16351 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16352 pub approach_z: f32,
16353 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16354 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16355 pub time_usec: u64,
16356}
16357impl HOME_POSITION_DATA {
16358 pub const ENCODED_LEN: usize = 60usize;
16359 pub const DEFAULT: Self = Self {
16360 latitude: 0_i32,
16361 longitude: 0_i32,
16362 altitude: 0_i32,
16363 x: 0.0_f32,
16364 y: 0.0_f32,
16365 z: 0.0_f32,
16366 q: [0.0_f32; 4usize],
16367 approach_x: 0.0_f32,
16368 approach_y: 0.0_f32,
16369 approach_z: 0.0_f32,
16370 time_usec: 0_u64,
16371 };
16372 #[cfg(feature = "arbitrary")]
16373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16374 use arbitrary::{Arbitrary, Unstructured};
16375 let mut buf = [0u8; 1024];
16376 rng.fill_bytes(&mut buf);
16377 let mut unstructured = Unstructured::new(&buf);
16378 Self::arbitrary(&mut unstructured).unwrap_or_default()
16379 }
16380}
16381impl Default for HOME_POSITION_DATA {
16382 fn default() -> Self {
16383 Self::DEFAULT.clone()
16384 }
16385}
16386impl MessageData for HOME_POSITION_DATA {
16387 type Message = MavMessage;
16388 const ID: u32 = 242u32;
16389 const NAME: &'static str = "HOME_POSITION";
16390 const EXTRA_CRC: u8 = 104u8;
16391 const ENCODED_LEN: usize = 60usize;
16392 fn deser(
16393 _version: MavlinkVersion,
16394 __input: &[u8],
16395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16396 let avail_len = __input.len();
16397 let mut payload_buf = [0; Self::ENCODED_LEN];
16398 let mut buf = if avail_len < Self::ENCODED_LEN {
16399 payload_buf[0..avail_len].copy_from_slice(__input);
16400 Bytes::new(&payload_buf)
16401 } else {
16402 Bytes::new(__input)
16403 };
16404 let mut __struct = Self::default();
16405 __struct.latitude = buf.get_i32_le();
16406 __struct.longitude = buf.get_i32_le();
16407 __struct.altitude = buf.get_i32_le();
16408 __struct.x = buf.get_f32_le();
16409 __struct.y = buf.get_f32_le();
16410 __struct.z = buf.get_f32_le();
16411 for v in &mut __struct.q {
16412 let val = buf.get_f32_le();
16413 *v = val;
16414 }
16415 __struct.approach_x = buf.get_f32_le();
16416 __struct.approach_y = buf.get_f32_le();
16417 __struct.approach_z = buf.get_f32_le();
16418 __struct.time_usec = buf.get_u64_le();
16419 Ok(__struct)
16420 }
16421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16422 let mut __tmp = BytesMut::new(bytes);
16423 #[allow(clippy::absurd_extreme_comparisons)]
16424 #[allow(unused_comparisons)]
16425 if __tmp.remaining() < Self::ENCODED_LEN {
16426 panic!(
16427 "buffer is too small (need {} bytes, but got {})",
16428 Self::ENCODED_LEN,
16429 __tmp.remaining(),
16430 )
16431 }
16432 __tmp.put_i32_le(self.latitude);
16433 __tmp.put_i32_le(self.longitude);
16434 __tmp.put_i32_le(self.altitude);
16435 __tmp.put_f32_le(self.x);
16436 __tmp.put_f32_le(self.y);
16437 __tmp.put_f32_le(self.z);
16438 for val in &self.q {
16439 __tmp.put_f32_le(*val);
16440 }
16441 __tmp.put_f32_le(self.approach_x);
16442 __tmp.put_f32_le(self.approach_y);
16443 __tmp.put_f32_le(self.approach_z);
16444 __tmp.put_u64_le(self.time_usec);
16445 if matches!(version, MavlinkVersion::V2) {
16446 let len = __tmp.len();
16447 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16448 } else {
16449 __tmp.len()
16450 }
16451 }
16452}
16453#[doc = "id: 12920"]
16454#[doc = "Temperature and humidity from hygrometer."]
16455#[derive(Debug, Clone, PartialEq)]
16456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16457#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16458pub struct HYGROMETER_SENSOR_DATA {
16459 #[doc = "Temperature"]
16460 pub temperature: i16,
16461 #[doc = "Humidity"]
16462 pub humidity: u16,
16463 #[doc = "Hygrometer ID"]
16464 pub id: u8,
16465}
16466impl HYGROMETER_SENSOR_DATA {
16467 pub const ENCODED_LEN: usize = 5usize;
16468 pub const DEFAULT: Self = Self {
16469 temperature: 0_i16,
16470 humidity: 0_u16,
16471 id: 0_u8,
16472 };
16473 #[cfg(feature = "arbitrary")]
16474 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16475 use arbitrary::{Arbitrary, Unstructured};
16476 let mut buf = [0u8; 1024];
16477 rng.fill_bytes(&mut buf);
16478 let mut unstructured = Unstructured::new(&buf);
16479 Self::arbitrary(&mut unstructured).unwrap_or_default()
16480 }
16481}
16482impl Default for HYGROMETER_SENSOR_DATA {
16483 fn default() -> Self {
16484 Self::DEFAULT.clone()
16485 }
16486}
16487impl MessageData for HYGROMETER_SENSOR_DATA {
16488 type Message = MavMessage;
16489 const ID: u32 = 12920u32;
16490 const NAME: &'static str = "HYGROMETER_SENSOR";
16491 const EXTRA_CRC: u8 = 20u8;
16492 const ENCODED_LEN: usize = 5usize;
16493 fn deser(
16494 _version: MavlinkVersion,
16495 __input: &[u8],
16496 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16497 let avail_len = __input.len();
16498 let mut payload_buf = [0; Self::ENCODED_LEN];
16499 let mut buf = if avail_len < Self::ENCODED_LEN {
16500 payload_buf[0..avail_len].copy_from_slice(__input);
16501 Bytes::new(&payload_buf)
16502 } else {
16503 Bytes::new(__input)
16504 };
16505 let mut __struct = Self::default();
16506 __struct.temperature = buf.get_i16_le();
16507 __struct.humidity = buf.get_u16_le();
16508 __struct.id = buf.get_u8();
16509 Ok(__struct)
16510 }
16511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16512 let mut __tmp = BytesMut::new(bytes);
16513 #[allow(clippy::absurd_extreme_comparisons)]
16514 #[allow(unused_comparisons)]
16515 if __tmp.remaining() < Self::ENCODED_LEN {
16516 panic!(
16517 "buffer is too small (need {} bytes, but got {})",
16518 Self::ENCODED_LEN,
16519 __tmp.remaining(),
16520 )
16521 }
16522 __tmp.put_i16_le(self.temperature);
16523 __tmp.put_u16_le(self.humidity);
16524 __tmp.put_u8(self.id);
16525 if matches!(version, MavlinkVersion::V2) {
16526 let len = __tmp.len();
16527 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16528 } else {
16529 __tmp.len()
16530 }
16531 }
16532}
16533#[doc = "id: 440"]
16534#[doc = "Illuminator status."]
16535#[derive(Debug, Clone, PartialEq)]
16536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16538pub struct ILLUMINATOR_STATUS_DATA {
16539 #[doc = "Time since the start-up of the illuminator in ms"]
16540 pub uptime_ms: u32,
16541 #[doc = "Errors"]
16542 pub error_status: IlluminatorErrorFlags,
16543 #[doc = "Illuminator brightness"]
16544 pub brightness: f32,
16545 #[doc = "Illuminator strobing period in seconds"]
16546 pub strobe_period: f32,
16547 #[doc = "Illuminator strobing duty cycle"]
16548 pub strobe_duty_cycle: f32,
16549 #[doc = "Temperature in Celsius"]
16550 pub temp_c: f32,
16551 #[doc = "Minimum strobing period in seconds"]
16552 pub min_strobe_period: f32,
16553 #[doc = "Maximum strobing period in seconds"]
16554 pub max_strobe_period: f32,
16555 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16556 pub enable: u8,
16557 #[doc = "Supported illuminator modes"]
16558 pub mode_bitmask: IlluminatorMode,
16559 #[doc = "Illuminator mode"]
16560 pub mode: IlluminatorMode,
16561}
16562impl ILLUMINATOR_STATUS_DATA {
16563 pub const ENCODED_LEN: usize = 35usize;
16564 pub const DEFAULT: Self = Self {
16565 uptime_ms: 0_u32,
16566 error_status: IlluminatorErrorFlags::DEFAULT,
16567 brightness: 0.0_f32,
16568 strobe_period: 0.0_f32,
16569 strobe_duty_cycle: 0.0_f32,
16570 temp_c: 0.0_f32,
16571 min_strobe_period: 0.0_f32,
16572 max_strobe_period: 0.0_f32,
16573 enable: 0_u8,
16574 mode_bitmask: IlluminatorMode::DEFAULT,
16575 mode: IlluminatorMode::DEFAULT,
16576 };
16577 #[cfg(feature = "arbitrary")]
16578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16579 use arbitrary::{Arbitrary, Unstructured};
16580 let mut buf = [0u8; 1024];
16581 rng.fill_bytes(&mut buf);
16582 let mut unstructured = Unstructured::new(&buf);
16583 Self::arbitrary(&mut unstructured).unwrap_or_default()
16584 }
16585}
16586impl Default for ILLUMINATOR_STATUS_DATA {
16587 fn default() -> Self {
16588 Self::DEFAULT.clone()
16589 }
16590}
16591impl MessageData for ILLUMINATOR_STATUS_DATA {
16592 type Message = MavMessage;
16593 const ID: u32 = 440u32;
16594 const NAME: &'static str = "ILLUMINATOR_STATUS";
16595 const EXTRA_CRC: u8 = 66u8;
16596 const ENCODED_LEN: usize = 35usize;
16597 fn deser(
16598 _version: MavlinkVersion,
16599 __input: &[u8],
16600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16601 let avail_len = __input.len();
16602 let mut payload_buf = [0; Self::ENCODED_LEN];
16603 let mut buf = if avail_len < Self::ENCODED_LEN {
16604 payload_buf[0..avail_len].copy_from_slice(__input);
16605 Bytes::new(&payload_buf)
16606 } else {
16607 Bytes::new(__input)
16608 };
16609 let mut __struct = Self::default();
16610 __struct.uptime_ms = buf.get_u32_le();
16611 let tmp = buf.get_u32_le();
16612 __struct.error_status = IlluminatorErrorFlags::from_bits(
16613 tmp & IlluminatorErrorFlags::all().bits(),
16614 )
16615 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16616 flag_type: "IlluminatorErrorFlags",
16617 value: tmp as u32,
16618 })?;
16619 __struct.brightness = buf.get_f32_le();
16620 __struct.strobe_period = buf.get_f32_le();
16621 __struct.strobe_duty_cycle = buf.get_f32_le();
16622 __struct.temp_c = buf.get_f32_le();
16623 __struct.min_strobe_period = buf.get_f32_le();
16624 __struct.max_strobe_period = buf.get_f32_le();
16625 __struct.enable = buf.get_u8();
16626 let tmp = buf.get_u8();
16627 __struct.mode_bitmask =
16628 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16629 enum_type: "IlluminatorMode",
16630 value: tmp as u32,
16631 })?;
16632 let tmp = buf.get_u8();
16633 __struct.mode =
16634 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16635 enum_type: "IlluminatorMode",
16636 value: tmp as u32,
16637 })?;
16638 Ok(__struct)
16639 }
16640 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16641 let mut __tmp = BytesMut::new(bytes);
16642 #[allow(clippy::absurd_extreme_comparisons)]
16643 #[allow(unused_comparisons)]
16644 if __tmp.remaining() < Self::ENCODED_LEN {
16645 panic!(
16646 "buffer is too small (need {} bytes, but got {})",
16647 Self::ENCODED_LEN,
16648 __tmp.remaining(),
16649 )
16650 }
16651 __tmp.put_u32_le(self.uptime_ms);
16652 __tmp.put_u32_le(self.error_status.bits());
16653 __tmp.put_f32_le(self.brightness);
16654 __tmp.put_f32_le(self.strobe_period);
16655 __tmp.put_f32_le(self.strobe_duty_cycle);
16656 __tmp.put_f32_le(self.temp_c);
16657 __tmp.put_f32_le(self.min_strobe_period);
16658 __tmp.put_f32_le(self.max_strobe_period);
16659 __tmp.put_u8(self.enable);
16660 __tmp.put_u8(self.mode_bitmask as u8);
16661 __tmp.put_u8(self.mode as u8);
16662 if matches!(version, MavlinkVersion::V2) {
16663 let len = __tmp.len();
16664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16665 } else {
16666 __tmp.len()
16667 }
16668 }
16669}
16670#[doc = "id: 335"]
16671#[doc = "Status of the Iridium SBD link."]
16672#[derive(Debug, Clone, PartialEq)]
16673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16675pub struct ISBD_LINK_STATUS_DATA {
16676 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16677 pub timestamp: u64,
16678 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16679 pub last_heartbeat: u64,
16680 #[doc = "Number of failed SBD sessions."]
16681 pub failed_sessions: u16,
16682 #[doc = "Number of successful SBD sessions."]
16683 pub successful_sessions: u16,
16684 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16685 pub signal_quality: u8,
16686 #[doc = "1: Ring call pending, 0: No call pending."]
16687 pub ring_pending: u8,
16688 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16689 pub tx_session_pending: u8,
16690 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16691 pub rx_session_pending: u8,
16692}
16693impl ISBD_LINK_STATUS_DATA {
16694 pub const ENCODED_LEN: usize = 24usize;
16695 pub const DEFAULT: Self = Self {
16696 timestamp: 0_u64,
16697 last_heartbeat: 0_u64,
16698 failed_sessions: 0_u16,
16699 successful_sessions: 0_u16,
16700 signal_quality: 0_u8,
16701 ring_pending: 0_u8,
16702 tx_session_pending: 0_u8,
16703 rx_session_pending: 0_u8,
16704 };
16705 #[cfg(feature = "arbitrary")]
16706 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16707 use arbitrary::{Arbitrary, Unstructured};
16708 let mut buf = [0u8; 1024];
16709 rng.fill_bytes(&mut buf);
16710 let mut unstructured = Unstructured::new(&buf);
16711 Self::arbitrary(&mut unstructured).unwrap_or_default()
16712 }
16713}
16714impl Default for ISBD_LINK_STATUS_DATA {
16715 fn default() -> Self {
16716 Self::DEFAULT.clone()
16717 }
16718}
16719impl MessageData for ISBD_LINK_STATUS_DATA {
16720 type Message = MavMessage;
16721 const ID: u32 = 335u32;
16722 const NAME: &'static str = "ISBD_LINK_STATUS";
16723 const EXTRA_CRC: u8 = 225u8;
16724 const ENCODED_LEN: usize = 24usize;
16725 fn deser(
16726 _version: MavlinkVersion,
16727 __input: &[u8],
16728 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16729 let avail_len = __input.len();
16730 let mut payload_buf = [0; Self::ENCODED_LEN];
16731 let mut buf = if avail_len < Self::ENCODED_LEN {
16732 payload_buf[0..avail_len].copy_from_slice(__input);
16733 Bytes::new(&payload_buf)
16734 } else {
16735 Bytes::new(__input)
16736 };
16737 let mut __struct = Self::default();
16738 __struct.timestamp = buf.get_u64_le();
16739 __struct.last_heartbeat = buf.get_u64_le();
16740 __struct.failed_sessions = buf.get_u16_le();
16741 __struct.successful_sessions = buf.get_u16_le();
16742 __struct.signal_quality = buf.get_u8();
16743 __struct.ring_pending = buf.get_u8();
16744 __struct.tx_session_pending = buf.get_u8();
16745 __struct.rx_session_pending = buf.get_u8();
16746 Ok(__struct)
16747 }
16748 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16749 let mut __tmp = BytesMut::new(bytes);
16750 #[allow(clippy::absurd_extreme_comparisons)]
16751 #[allow(unused_comparisons)]
16752 if __tmp.remaining() < Self::ENCODED_LEN {
16753 panic!(
16754 "buffer is too small (need {} bytes, but got {})",
16755 Self::ENCODED_LEN,
16756 __tmp.remaining(),
16757 )
16758 }
16759 __tmp.put_u64_le(self.timestamp);
16760 __tmp.put_u64_le(self.last_heartbeat);
16761 __tmp.put_u16_le(self.failed_sessions);
16762 __tmp.put_u16_le(self.successful_sessions);
16763 __tmp.put_u8(self.signal_quality);
16764 __tmp.put_u8(self.ring_pending);
16765 __tmp.put_u8(self.tx_session_pending);
16766 __tmp.put_u8(self.rx_session_pending);
16767 if matches!(version, MavlinkVersion::V2) {
16768 let len = __tmp.len();
16769 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16770 } else {
16771 __tmp.len()
16772 }
16773 }
16774}
16775#[doc = "id: 149"]
16776#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
16777#[derive(Debug, Clone, PartialEq)]
16778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16780pub struct LANDING_TARGET_DATA {
16781 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16782 pub time_usec: u64,
16783 #[doc = "X-axis angular offset of the target from the center of the image"]
16784 pub angle_x: f32,
16785 #[doc = "Y-axis angular offset of the target from the center of the image"]
16786 pub angle_y: f32,
16787 #[doc = "Distance to the target from the vehicle"]
16788 pub distance: f32,
16789 #[doc = "Size of target along x-axis"]
16790 pub size_x: f32,
16791 #[doc = "Size of target along y-axis"]
16792 pub size_y: f32,
16793 #[doc = "The ID of the target if multiple targets are present"]
16794 pub target_num: u8,
16795 #[doc = "Coordinate frame used for following fields."]
16796 pub frame: MavFrame,
16797 #[doc = "X Position of the landing target in MAV_FRAME"]
16798 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16799 pub x: f32,
16800 #[doc = "Y Position of the landing target in MAV_FRAME"]
16801 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16802 pub y: f32,
16803 #[doc = "Z Position of the landing target in MAV_FRAME"]
16804 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16805 pub z: f32,
16806 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
16807 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16808 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16809 pub q: [f32; 4],
16810 #[doc = "Type of landing target"]
16811 #[cfg_attr(feature = "serde", serde(default))]
16812 pub mavtype: LandingTargetType,
16813 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
16814 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16815 pub position_valid: u8,
16816}
16817impl LANDING_TARGET_DATA {
16818 pub const ENCODED_LEN: usize = 60usize;
16819 pub const DEFAULT: Self = Self {
16820 time_usec: 0_u64,
16821 angle_x: 0.0_f32,
16822 angle_y: 0.0_f32,
16823 distance: 0.0_f32,
16824 size_x: 0.0_f32,
16825 size_y: 0.0_f32,
16826 target_num: 0_u8,
16827 frame: MavFrame::DEFAULT,
16828 x: 0.0_f32,
16829 y: 0.0_f32,
16830 z: 0.0_f32,
16831 q: [0.0_f32; 4usize],
16832 mavtype: LandingTargetType::DEFAULT,
16833 position_valid: 0_u8,
16834 };
16835 #[cfg(feature = "arbitrary")]
16836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16837 use arbitrary::{Arbitrary, Unstructured};
16838 let mut buf = [0u8; 1024];
16839 rng.fill_bytes(&mut buf);
16840 let mut unstructured = Unstructured::new(&buf);
16841 Self::arbitrary(&mut unstructured).unwrap_or_default()
16842 }
16843}
16844impl Default for LANDING_TARGET_DATA {
16845 fn default() -> Self {
16846 Self::DEFAULT.clone()
16847 }
16848}
16849impl MessageData for LANDING_TARGET_DATA {
16850 type Message = MavMessage;
16851 const ID: u32 = 149u32;
16852 const NAME: &'static str = "LANDING_TARGET";
16853 const EXTRA_CRC: u8 = 200u8;
16854 const ENCODED_LEN: usize = 60usize;
16855 fn deser(
16856 _version: MavlinkVersion,
16857 __input: &[u8],
16858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16859 let avail_len = __input.len();
16860 let mut payload_buf = [0; Self::ENCODED_LEN];
16861 let mut buf = if avail_len < Self::ENCODED_LEN {
16862 payload_buf[0..avail_len].copy_from_slice(__input);
16863 Bytes::new(&payload_buf)
16864 } else {
16865 Bytes::new(__input)
16866 };
16867 let mut __struct = Self::default();
16868 __struct.time_usec = buf.get_u64_le();
16869 __struct.angle_x = buf.get_f32_le();
16870 __struct.angle_y = buf.get_f32_le();
16871 __struct.distance = buf.get_f32_le();
16872 __struct.size_x = buf.get_f32_le();
16873 __struct.size_y = buf.get_f32_le();
16874 __struct.target_num = buf.get_u8();
16875 let tmp = buf.get_u8();
16876 __struct.frame =
16877 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16878 enum_type: "MavFrame",
16879 value: tmp as u32,
16880 })?;
16881 __struct.x = buf.get_f32_le();
16882 __struct.y = buf.get_f32_le();
16883 __struct.z = buf.get_f32_le();
16884 for v in &mut __struct.q {
16885 let val = buf.get_f32_le();
16886 *v = val;
16887 }
16888 let tmp = buf.get_u8();
16889 __struct.mavtype =
16890 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16891 enum_type: "LandingTargetType",
16892 value: tmp as u32,
16893 })?;
16894 __struct.position_valid = buf.get_u8();
16895 Ok(__struct)
16896 }
16897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16898 let mut __tmp = BytesMut::new(bytes);
16899 #[allow(clippy::absurd_extreme_comparisons)]
16900 #[allow(unused_comparisons)]
16901 if __tmp.remaining() < Self::ENCODED_LEN {
16902 panic!(
16903 "buffer is too small (need {} bytes, but got {})",
16904 Self::ENCODED_LEN,
16905 __tmp.remaining(),
16906 )
16907 }
16908 __tmp.put_u64_le(self.time_usec);
16909 __tmp.put_f32_le(self.angle_x);
16910 __tmp.put_f32_le(self.angle_y);
16911 __tmp.put_f32_le(self.distance);
16912 __tmp.put_f32_le(self.size_x);
16913 __tmp.put_f32_le(self.size_y);
16914 __tmp.put_u8(self.target_num);
16915 __tmp.put_u8(self.frame as u8);
16916 __tmp.put_f32_le(self.x);
16917 __tmp.put_f32_le(self.y);
16918 __tmp.put_f32_le(self.z);
16919 for val in &self.q {
16920 __tmp.put_f32_le(*val);
16921 }
16922 __tmp.put_u8(self.mavtype as u8);
16923 __tmp.put_u8(self.position_valid);
16924 if matches!(version, MavlinkVersion::V2) {
16925 let len = __tmp.len();
16926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16927 } else {
16928 __tmp.len()
16929 }
16930 }
16931}
16932#[doc = "id: 8"]
16933#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
16934#[derive(Debug, Clone, PartialEq)]
16935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16937pub struct LINK_NODE_STATUS_DATA {
16938 #[doc = "Timestamp (time since system boot)."]
16939 pub timestamp: u64,
16940 #[doc = "Transmit rate"]
16941 pub tx_rate: u32,
16942 #[doc = "Receive rate"]
16943 pub rx_rate: u32,
16944 #[doc = "Messages sent"]
16945 pub messages_sent: u32,
16946 #[doc = "Messages received (estimated from counting seq)"]
16947 pub messages_received: u32,
16948 #[doc = "Messages lost (estimated from counting seq)"]
16949 pub messages_lost: u32,
16950 #[doc = "Number of bytes that could not be parsed correctly."]
16951 pub rx_parse_err: u16,
16952 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16953 pub tx_overflows: u16,
16954 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16955 pub rx_overflows: u16,
16956 #[doc = "Remaining free transmit buffer space"]
16957 pub tx_buf: u8,
16958 #[doc = "Remaining free receive buffer space"]
16959 pub rx_buf: u8,
16960}
16961impl LINK_NODE_STATUS_DATA {
16962 pub const ENCODED_LEN: usize = 36usize;
16963 pub const DEFAULT: Self = Self {
16964 timestamp: 0_u64,
16965 tx_rate: 0_u32,
16966 rx_rate: 0_u32,
16967 messages_sent: 0_u32,
16968 messages_received: 0_u32,
16969 messages_lost: 0_u32,
16970 rx_parse_err: 0_u16,
16971 tx_overflows: 0_u16,
16972 rx_overflows: 0_u16,
16973 tx_buf: 0_u8,
16974 rx_buf: 0_u8,
16975 };
16976 #[cfg(feature = "arbitrary")]
16977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16978 use arbitrary::{Arbitrary, Unstructured};
16979 let mut buf = [0u8; 1024];
16980 rng.fill_bytes(&mut buf);
16981 let mut unstructured = Unstructured::new(&buf);
16982 Self::arbitrary(&mut unstructured).unwrap_or_default()
16983 }
16984}
16985impl Default for LINK_NODE_STATUS_DATA {
16986 fn default() -> Self {
16987 Self::DEFAULT.clone()
16988 }
16989}
16990impl MessageData for LINK_NODE_STATUS_DATA {
16991 type Message = MavMessage;
16992 const ID: u32 = 8u32;
16993 const NAME: &'static str = "LINK_NODE_STATUS";
16994 const EXTRA_CRC: u8 = 117u8;
16995 const ENCODED_LEN: usize = 36usize;
16996 fn deser(
16997 _version: MavlinkVersion,
16998 __input: &[u8],
16999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17000 let avail_len = __input.len();
17001 let mut payload_buf = [0; Self::ENCODED_LEN];
17002 let mut buf = if avail_len < Self::ENCODED_LEN {
17003 payload_buf[0..avail_len].copy_from_slice(__input);
17004 Bytes::new(&payload_buf)
17005 } else {
17006 Bytes::new(__input)
17007 };
17008 let mut __struct = Self::default();
17009 __struct.timestamp = buf.get_u64_le();
17010 __struct.tx_rate = buf.get_u32_le();
17011 __struct.rx_rate = buf.get_u32_le();
17012 __struct.messages_sent = buf.get_u32_le();
17013 __struct.messages_received = buf.get_u32_le();
17014 __struct.messages_lost = buf.get_u32_le();
17015 __struct.rx_parse_err = buf.get_u16_le();
17016 __struct.tx_overflows = buf.get_u16_le();
17017 __struct.rx_overflows = buf.get_u16_le();
17018 __struct.tx_buf = buf.get_u8();
17019 __struct.rx_buf = buf.get_u8();
17020 Ok(__struct)
17021 }
17022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17023 let mut __tmp = BytesMut::new(bytes);
17024 #[allow(clippy::absurd_extreme_comparisons)]
17025 #[allow(unused_comparisons)]
17026 if __tmp.remaining() < Self::ENCODED_LEN {
17027 panic!(
17028 "buffer is too small (need {} bytes, but got {})",
17029 Self::ENCODED_LEN,
17030 __tmp.remaining(),
17031 )
17032 }
17033 __tmp.put_u64_le(self.timestamp);
17034 __tmp.put_u32_le(self.tx_rate);
17035 __tmp.put_u32_le(self.rx_rate);
17036 __tmp.put_u32_le(self.messages_sent);
17037 __tmp.put_u32_le(self.messages_received);
17038 __tmp.put_u32_le(self.messages_lost);
17039 __tmp.put_u16_le(self.rx_parse_err);
17040 __tmp.put_u16_le(self.tx_overflows);
17041 __tmp.put_u16_le(self.rx_overflows);
17042 __tmp.put_u8(self.tx_buf);
17043 __tmp.put_u8(self.rx_buf);
17044 if matches!(version, MavlinkVersion::V2) {
17045 let len = __tmp.len();
17046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17047 } else {
17048 __tmp.len()
17049 }
17050 }
17051}
17052#[doc = "id: 32"]
17053#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17054#[derive(Debug, Clone, PartialEq)]
17055#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17057pub struct LOCAL_POSITION_NED_DATA {
17058 #[doc = "Timestamp (time since system boot)."]
17059 pub time_boot_ms: u32,
17060 #[doc = "X Position"]
17061 pub x: f32,
17062 #[doc = "Y Position"]
17063 pub y: f32,
17064 #[doc = "Z Position"]
17065 pub z: f32,
17066 #[doc = "X Speed"]
17067 pub vx: f32,
17068 #[doc = "Y Speed"]
17069 pub vy: f32,
17070 #[doc = "Z Speed"]
17071 pub vz: f32,
17072}
17073impl LOCAL_POSITION_NED_DATA {
17074 pub const ENCODED_LEN: usize = 28usize;
17075 pub const DEFAULT: Self = Self {
17076 time_boot_ms: 0_u32,
17077 x: 0.0_f32,
17078 y: 0.0_f32,
17079 z: 0.0_f32,
17080 vx: 0.0_f32,
17081 vy: 0.0_f32,
17082 vz: 0.0_f32,
17083 };
17084 #[cfg(feature = "arbitrary")]
17085 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17086 use arbitrary::{Arbitrary, Unstructured};
17087 let mut buf = [0u8; 1024];
17088 rng.fill_bytes(&mut buf);
17089 let mut unstructured = Unstructured::new(&buf);
17090 Self::arbitrary(&mut unstructured).unwrap_or_default()
17091 }
17092}
17093impl Default for LOCAL_POSITION_NED_DATA {
17094 fn default() -> Self {
17095 Self::DEFAULT.clone()
17096 }
17097}
17098impl MessageData for LOCAL_POSITION_NED_DATA {
17099 type Message = MavMessage;
17100 const ID: u32 = 32u32;
17101 const NAME: &'static str = "LOCAL_POSITION_NED";
17102 const EXTRA_CRC: u8 = 185u8;
17103 const ENCODED_LEN: usize = 28usize;
17104 fn deser(
17105 _version: MavlinkVersion,
17106 __input: &[u8],
17107 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17108 let avail_len = __input.len();
17109 let mut payload_buf = [0; Self::ENCODED_LEN];
17110 let mut buf = if avail_len < Self::ENCODED_LEN {
17111 payload_buf[0..avail_len].copy_from_slice(__input);
17112 Bytes::new(&payload_buf)
17113 } else {
17114 Bytes::new(__input)
17115 };
17116 let mut __struct = Self::default();
17117 __struct.time_boot_ms = buf.get_u32_le();
17118 __struct.x = buf.get_f32_le();
17119 __struct.y = buf.get_f32_le();
17120 __struct.z = buf.get_f32_le();
17121 __struct.vx = buf.get_f32_le();
17122 __struct.vy = buf.get_f32_le();
17123 __struct.vz = buf.get_f32_le();
17124 Ok(__struct)
17125 }
17126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17127 let mut __tmp = BytesMut::new(bytes);
17128 #[allow(clippy::absurd_extreme_comparisons)]
17129 #[allow(unused_comparisons)]
17130 if __tmp.remaining() < Self::ENCODED_LEN {
17131 panic!(
17132 "buffer is too small (need {} bytes, but got {})",
17133 Self::ENCODED_LEN,
17134 __tmp.remaining(),
17135 )
17136 }
17137 __tmp.put_u32_le(self.time_boot_ms);
17138 __tmp.put_f32_le(self.x);
17139 __tmp.put_f32_le(self.y);
17140 __tmp.put_f32_le(self.z);
17141 __tmp.put_f32_le(self.vx);
17142 __tmp.put_f32_le(self.vy);
17143 __tmp.put_f32_le(self.vz);
17144 if matches!(version, MavlinkVersion::V2) {
17145 let len = __tmp.len();
17146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17147 } else {
17148 __tmp.len()
17149 }
17150 }
17151}
17152#[doc = "id: 64"]
17153#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17154#[derive(Debug, Clone, PartialEq)]
17155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17157pub struct LOCAL_POSITION_NED_COV_DATA {
17158 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17159 pub time_usec: u64,
17160 #[doc = "X Position"]
17161 pub x: f32,
17162 #[doc = "Y Position"]
17163 pub y: f32,
17164 #[doc = "Z Position"]
17165 pub z: f32,
17166 #[doc = "X Speed"]
17167 pub vx: f32,
17168 #[doc = "Y Speed"]
17169 pub vy: f32,
17170 #[doc = "Z Speed"]
17171 pub vz: f32,
17172 #[doc = "X Acceleration"]
17173 pub ax: f32,
17174 #[doc = "Y Acceleration"]
17175 pub ay: f32,
17176 #[doc = "Z Acceleration"]
17177 pub az: f32,
17178 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17179 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17180 pub covariance: [f32; 45],
17181 #[doc = "Class id of the estimator this estimate originated from."]
17182 pub estimator_type: MavEstimatorType,
17183}
17184impl LOCAL_POSITION_NED_COV_DATA {
17185 pub const ENCODED_LEN: usize = 225usize;
17186 pub const DEFAULT: Self = Self {
17187 time_usec: 0_u64,
17188 x: 0.0_f32,
17189 y: 0.0_f32,
17190 z: 0.0_f32,
17191 vx: 0.0_f32,
17192 vy: 0.0_f32,
17193 vz: 0.0_f32,
17194 ax: 0.0_f32,
17195 ay: 0.0_f32,
17196 az: 0.0_f32,
17197 covariance: [0.0_f32; 45usize],
17198 estimator_type: MavEstimatorType::DEFAULT,
17199 };
17200 #[cfg(feature = "arbitrary")]
17201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17202 use arbitrary::{Arbitrary, Unstructured};
17203 let mut buf = [0u8; 1024];
17204 rng.fill_bytes(&mut buf);
17205 let mut unstructured = Unstructured::new(&buf);
17206 Self::arbitrary(&mut unstructured).unwrap_or_default()
17207 }
17208}
17209impl Default for LOCAL_POSITION_NED_COV_DATA {
17210 fn default() -> Self {
17211 Self::DEFAULT.clone()
17212 }
17213}
17214impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17215 type Message = MavMessage;
17216 const ID: u32 = 64u32;
17217 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17218 const EXTRA_CRC: u8 = 191u8;
17219 const ENCODED_LEN: usize = 225usize;
17220 fn deser(
17221 _version: MavlinkVersion,
17222 __input: &[u8],
17223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17224 let avail_len = __input.len();
17225 let mut payload_buf = [0; Self::ENCODED_LEN];
17226 let mut buf = if avail_len < Self::ENCODED_LEN {
17227 payload_buf[0..avail_len].copy_from_slice(__input);
17228 Bytes::new(&payload_buf)
17229 } else {
17230 Bytes::new(__input)
17231 };
17232 let mut __struct = Self::default();
17233 __struct.time_usec = buf.get_u64_le();
17234 __struct.x = buf.get_f32_le();
17235 __struct.y = buf.get_f32_le();
17236 __struct.z = buf.get_f32_le();
17237 __struct.vx = buf.get_f32_le();
17238 __struct.vy = buf.get_f32_le();
17239 __struct.vz = buf.get_f32_le();
17240 __struct.ax = buf.get_f32_le();
17241 __struct.ay = buf.get_f32_le();
17242 __struct.az = buf.get_f32_le();
17243 for v in &mut __struct.covariance {
17244 let val = buf.get_f32_le();
17245 *v = val;
17246 }
17247 let tmp = buf.get_u8();
17248 __struct.estimator_type =
17249 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17250 enum_type: "MavEstimatorType",
17251 value: tmp as u32,
17252 })?;
17253 Ok(__struct)
17254 }
17255 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17256 let mut __tmp = BytesMut::new(bytes);
17257 #[allow(clippy::absurd_extreme_comparisons)]
17258 #[allow(unused_comparisons)]
17259 if __tmp.remaining() < Self::ENCODED_LEN {
17260 panic!(
17261 "buffer is too small (need {} bytes, but got {})",
17262 Self::ENCODED_LEN,
17263 __tmp.remaining(),
17264 )
17265 }
17266 __tmp.put_u64_le(self.time_usec);
17267 __tmp.put_f32_le(self.x);
17268 __tmp.put_f32_le(self.y);
17269 __tmp.put_f32_le(self.z);
17270 __tmp.put_f32_le(self.vx);
17271 __tmp.put_f32_le(self.vy);
17272 __tmp.put_f32_le(self.vz);
17273 __tmp.put_f32_le(self.ax);
17274 __tmp.put_f32_le(self.ay);
17275 __tmp.put_f32_le(self.az);
17276 for val in &self.covariance {
17277 __tmp.put_f32_le(*val);
17278 }
17279 __tmp.put_u8(self.estimator_type as u8);
17280 if matches!(version, MavlinkVersion::V2) {
17281 let len = __tmp.len();
17282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17283 } else {
17284 __tmp.len()
17285 }
17286 }
17287}
17288#[doc = "id: 89"]
17289#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17290#[derive(Debug, Clone, PartialEq)]
17291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17293pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17294 #[doc = "Timestamp (time since system boot)."]
17295 pub time_boot_ms: u32,
17296 #[doc = "X Position"]
17297 pub x: f32,
17298 #[doc = "Y Position"]
17299 pub y: f32,
17300 #[doc = "Z Position"]
17301 pub z: f32,
17302 #[doc = "Roll"]
17303 pub roll: f32,
17304 #[doc = "Pitch"]
17305 pub pitch: f32,
17306 #[doc = "Yaw"]
17307 pub yaw: f32,
17308}
17309impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17310 pub const ENCODED_LEN: usize = 28usize;
17311 pub const DEFAULT: Self = Self {
17312 time_boot_ms: 0_u32,
17313 x: 0.0_f32,
17314 y: 0.0_f32,
17315 z: 0.0_f32,
17316 roll: 0.0_f32,
17317 pitch: 0.0_f32,
17318 yaw: 0.0_f32,
17319 };
17320 #[cfg(feature = "arbitrary")]
17321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17322 use arbitrary::{Arbitrary, Unstructured};
17323 let mut buf = [0u8; 1024];
17324 rng.fill_bytes(&mut buf);
17325 let mut unstructured = Unstructured::new(&buf);
17326 Self::arbitrary(&mut unstructured).unwrap_or_default()
17327 }
17328}
17329impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17330 fn default() -> Self {
17331 Self::DEFAULT.clone()
17332 }
17333}
17334impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17335 type Message = MavMessage;
17336 const ID: u32 = 89u32;
17337 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17338 const EXTRA_CRC: u8 = 231u8;
17339 const ENCODED_LEN: usize = 28usize;
17340 fn deser(
17341 _version: MavlinkVersion,
17342 __input: &[u8],
17343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17344 let avail_len = __input.len();
17345 let mut payload_buf = [0; Self::ENCODED_LEN];
17346 let mut buf = if avail_len < Self::ENCODED_LEN {
17347 payload_buf[0..avail_len].copy_from_slice(__input);
17348 Bytes::new(&payload_buf)
17349 } else {
17350 Bytes::new(__input)
17351 };
17352 let mut __struct = Self::default();
17353 __struct.time_boot_ms = buf.get_u32_le();
17354 __struct.x = buf.get_f32_le();
17355 __struct.y = buf.get_f32_le();
17356 __struct.z = buf.get_f32_le();
17357 __struct.roll = buf.get_f32_le();
17358 __struct.pitch = buf.get_f32_le();
17359 __struct.yaw = buf.get_f32_le();
17360 Ok(__struct)
17361 }
17362 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17363 let mut __tmp = BytesMut::new(bytes);
17364 #[allow(clippy::absurd_extreme_comparisons)]
17365 #[allow(unused_comparisons)]
17366 if __tmp.remaining() < Self::ENCODED_LEN {
17367 panic!(
17368 "buffer is too small (need {} bytes, but got {})",
17369 Self::ENCODED_LEN,
17370 __tmp.remaining(),
17371 )
17372 }
17373 __tmp.put_u32_le(self.time_boot_ms);
17374 __tmp.put_f32_le(self.x);
17375 __tmp.put_f32_le(self.y);
17376 __tmp.put_f32_le(self.z);
17377 __tmp.put_f32_le(self.roll);
17378 __tmp.put_f32_le(self.pitch);
17379 __tmp.put_f32_le(self.yaw);
17380 if matches!(version, MavlinkVersion::V2) {
17381 let len = __tmp.len();
17382 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17383 } else {
17384 __tmp.len()
17385 }
17386 }
17387}
17388#[doc = "id: 268"]
17389#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17390#[derive(Debug, Clone, PartialEq)]
17391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17393pub struct LOGGING_ACK_DATA {
17394 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17395 pub sequence: u16,
17396 #[doc = "system ID of the target"]
17397 pub target_system: u8,
17398 #[doc = "component ID of the target"]
17399 pub target_component: u8,
17400}
17401impl LOGGING_ACK_DATA {
17402 pub const ENCODED_LEN: usize = 4usize;
17403 pub const DEFAULT: Self = Self {
17404 sequence: 0_u16,
17405 target_system: 0_u8,
17406 target_component: 0_u8,
17407 };
17408 #[cfg(feature = "arbitrary")]
17409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17410 use arbitrary::{Arbitrary, Unstructured};
17411 let mut buf = [0u8; 1024];
17412 rng.fill_bytes(&mut buf);
17413 let mut unstructured = Unstructured::new(&buf);
17414 Self::arbitrary(&mut unstructured).unwrap_or_default()
17415 }
17416}
17417impl Default for LOGGING_ACK_DATA {
17418 fn default() -> Self {
17419 Self::DEFAULT.clone()
17420 }
17421}
17422impl MessageData for LOGGING_ACK_DATA {
17423 type Message = MavMessage;
17424 const ID: u32 = 268u32;
17425 const NAME: &'static str = "LOGGING_ACK";
17426 const EXTRA_CRC: u8 = 14u8;
17427 const ENCODED_LEN: usize = 4usize;
17428 fn deser(
17429 _version: MavlinkVersion,
17430 __input: &[u8],
17431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17432 let avail_len = __input.len();
17433 let mut payload_buf = [0; Self::ENCODED_LEN];
17434 let mut buf = if avail_len < Self::ENCODED_LEN {
17435 payload_buf[0..avail_len].copy_from_slice(__input);
17436 Bytes::new(&payload_buf)
17437 } else {
17438 Bytes::new(__input)
17439 };
17440 let mut __struct = Self::default();
17441 __struct.sequence = buf.get_u16_le();
17442 __struct.target_system = buf.get_u8();
17443 __struct.target_component = buf.get_u8();
17444 Ok(__struct)
17445 }
17446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17447 let mut __tmp = BytesMut::new(bytes);
17448 #[allow(clippy::absurd_extreme_comparisons)]
17449 #[allow(unused_comparisons)]
17450 if __tmp.remaining() < Self::ENCODED_LEN {
17451 panic!(
17452 "buffer is too small (need {} bytes, but got {})",
17453 Self::ENCODED_LEN,
17454 __tmp.remaining(),
17455 )
17456 }
17457 __tmp.put_u16_le(self.sequence);
17458 __tmp.put_u8(self.target_system);
17459 __tmp.put_u8(self.target_component);
17460 if matches!(version, MavlinkVersion::V2) {
17461 let len = __tmp.len();
17462 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17463 } else {
17464 __tmp.len()
17465 }
17466 }
17467}
17468#[doc = "id: 266"]
17469#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17470#[derive(Debug, Clone, PartialEq)]
17471#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17472#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17473pub struct LOGGING_DATA_DATA {
17474 #[doc = "sequence number (can wrap)"]
17475 pub sequence: u16,
17476 #[doc = "system ID of the target"]
17477 pub target_system: u8,
17478 #[doc = "component ID of the target"]
17479 pub target_component: u8,
17480 #[doc = "data length"]
17481 pub length: u8,
17482 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17483 pub first_message_offset: u8,
17484 #[doc = "logged data"]
17485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17486 pub data: [u8; 249],
17487}
17488impl LOGGING_DATA_DATA {
17489 pub const ENCODED_LEN: usize = 255usize;
17490 pub const DEFAULT: Self = Self {
17491 sequence: 0_u16,
17492 target_system: 0_u8,
17493 target_component: 0_u8,
17494 length: 0_u8,
17495 first_message_offset: 0_u8,
17496 data: [0_u8; 249usize],
17497 };
17498 #[cfg(feature = "arbitrary")]
17499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17500 use arbitrary::{Arbitrary, Unstructured};
17501 let mut buf = [0u8; 1024];
17502 rng.fill_bytes(&mut buf);
17503 let mut unstructured = Unstructured::new(&buf);
17504 Self::arbitrary(&mut unstructured).unwrap_or_default()
17505 }
17506}
17507impl Default for LOGGING_DATA_DATA {
17508 fn default() -> Self {
17509 Self::DEFAULT.clone()
17510 }
17511}
17512impl MessageData for LOGGING_DATA_DATA {
17513 type Message = MavMessage;
17514 const ID: u32 = 266u32;
17515 const NAME: &'static str = "LOGGING_DATA";
17516 const EXTRA_CRC: u8 = 193u8;
17517 const ENCODED_LEN: usize = 255usize;
17518 fn deser(
17519 _version: MavlinkVersion,
17520 __input: &[u8],
17521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17522 let avail_len = __input.len();
17523 let mut payload_buf = [0; Self::ENCODED_LEN];
17524 let mut buf = if avail_len < Self::ENCODED_LEN {
17525 payload_buf[0..avail_len].copy_from_slice(__input);
17526 Bytes::new(&payload_buf)
17527 } else {
17528 Bytes::new(__input)
17529 };
17530 let mut __struct = Self::default();
17531 __struct.sequence = buf.get_u16_le();
17532 __struct.target_system = buf.get_u8();
17533 __struct.target_component = buf.get_u8();
17534 __struct.length = buf.get_u8();
17535 __struct.first_message_offset = buf.get_u8();
17536 for v in &mut __struct.data {
17537 let val = buf.get_u8();
17538 *v = val;
17539 }
17540 Ok(__struct)
17541 }
17542 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17543 let mut __tmp = BytesMut::new(bytes);
17544 #[allow(clippy::absurd_extreme_comparisons)]
17545 #[allow(unused_comparisons)]
17546 if __tmp.remaining() < Self::ENCODED_LEN {
17547 panic!(
17548 "buffer is too small (need {} bytes, but got {})",
17549 Self::ENCODED_LEN,
17550 __tmp.remaining(),
17551 )
17552 }
17553 __tmp.put_u16_le(self.sequence);
17554 __tmp.put_u8(self.target_system);
17555 __tmp.put_u8(self.target_component);
17556 __tmp.put_u8(self.length);
17557 __tmp.put_u8(self.first_message_offset);
17558 for val in &self.data {
17559 __tmp.put_u8(*val);
17560 }
17561 if matches!(version, MavlinkVersion::V2) {
17562 let len = __tmp.len();
17563 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17564 } else {
17565 __tmp.len()
17566 }
17567 }
17568}
17569#[doc = "id: 267"]
17570#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17571#[derive(Debug, Clone, PartialEq)]
17572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17574pub struct LOGGING_DATA_ACKED_DATA {
17575 #[doc = "sequence number (can wrap)"]
17576 pub sequence: u16,
17577 #[doc = "system ID of the target"]
17578 pub target_system: u8,
17579 #[doc = "component ID of the target"]
17580 pub target_component: u8,
17581 #[doc = "data length"]
17582 pub length: u8,
17583 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17584 pub first_message_offset: u8,
17585 #[doc = "logged data"]
17586 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17587 pub data: [u8; 249],
17588}
17589impl LOGGING_DATA_ACKED_DATA {
17590 pub const ENCODED_LEN: usize = 255usize;
17591 pub const DEFAULT: Self = Self {
17592 sequence: 0_u16,
17593 target_system: 0_u8,
17594 target_component: 0_u8,
17595 length: 0_u8,
17596 first_message_offset: 0_u8,
17597 data: [0_u8; 249usize],
17598 };
17599 #[cfg(feature = "arbitrary")]
17600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17601 use arbitrary::{Arbitrary, Unstructured};
17602 let mut buf = [0u8; 1024];
17603 rng.fill_bytes(&mut buf);
17604 let mut unstructured = Unstructured::new(&buf);
17605 Self::arbitrary(&mut unstructured).unwrap_or_default()
17606 }
17607}
17608impl Default for LOGGING_DATA_ACKED_DATA {
17609 fn default() -> Self {
17610 Self::DEFAULT.clone()
17611 }
17612}
17613impl MessageData for LOGGING_DATA_ACKED_DATA {
17614 type Message = MavMessage;
17615 const ID: u32 = 267u32;
17616 const NAME: &'static str = "LOGGING_DATA_ACKED";
17617 const EXTRA_CRC: u8 = 35u8;
17618 const ENCODED_LEN: usize = 255usize;
17619 fn deser(
17620 _version: MavlinkVersion,
17621 __input: &[u8],
17622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17623 let avail_len = __input.len();
17624 let mut payload_buf = [0; Self::ENCODED_LEN];
17625 let mut buf = if avail_len < Self::ENCODED_LEN {
17626 payload_buf[0..avail_len].copy_from_slice(__input);
17627 Bytes::new(&payload_buf)
17628 } else {
17629 Bytes::new(__input)
17630 };
17631 let mut __struct = Self::default();
17632 __struct.sequence = buf.get_u16_le();
17633 __struct.target_system = buf.get_u8();
17634 __struct.target_component = buf.get_u8();
17635 __struct.length = buf.get_u8();
17636 __struct.first_message_offset = buf.get_u8();
17637 for v in &mut __struct.data {
17638 let val = buf.get_u8();
17639 *v = val;
17640 }
17641 Ok(__struct)
17642 }
17643 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17644 let mut __tmp = BytesMut::new(bytes);
17645 #[allow(clippy::absurd_extreme_comparisons)]
17646 #[allow(unused_comparisons)]
17647 if __tmp.remaining() < Self::ENCODED_LEN {
17648 panic!(
17649 "buffer is too small (need {} bytes, but got {})",
17650 Self::ENCODED_LEN,
17651 __tmp.remaining(),
17652 )
17653 }
17654 __tmp.put_u16_le(self.sequence);
17655 __tmp.put_u8(self.target_system);
17656 __tmp.put_u8(self.target_component);
17657 __tmp.put_u8(self.length);
17658 __tmp.put_u8(self.first_message_offset);
17659 for val in &self.data {
17660 __tmp.put_u8(*val);
17661 }
17662 if matches!(version, MavlinkVersion::V2) {
17663 let len = __tmp.len();
17664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17665 } else {
17666 __tmp.len()
17667 }
17668 }
17669}
17670#[doc = "id: 120"]
17671#[doc = "Reply to LOG_REQUEST_DATA."]
17672#[derive(Debug, Clone, PartialEq)]
17673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17675pub struct LOG_DATA_DATA {
17676 #[doc = "Offset into the log"]
17677 pub ofs: u32,
17678 #[doc = "Log id (from LOG_ENTRY reply)"]
17679 pub id: u16,
17680 #[doc = "Number of bytes (zero for end of log)"]
17681 pub count: u8,
17682 #[doc = "log data"]
17683 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17684 pub data: [u8; 90],
17685}
17686impl LOG_DATA_DATA {
17687 pub const ENCODED_LEN: usize = 97usize;
17688 pub const DEFAULT: Self = Self {
17689 ofs: 0_u32,
17690 id: 0_u16,
17691 count: 0_u8,
17692 data: [0_u8; 90usize],
17693 };
17694 #[cfg(feature = "arbitrary")]
17695 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17696 use arbitrary::{Arbitrary, Unstructured};
17697 let mut buf = [0u8; 1024];
17698 rng.fill_bytes(&mut buf);
17699 let mut unstructured = Unstructured::new(&buf);
17700 Self::arbitrary(&mut unstructured).unwrap_or_default()
17701 }
17702}
17703impl Default for LOG_DATA_DATA {
17704 fn default() -> Self {
17705 Self::DEFAULT.clone()
17706 }
17707}
17708impl MessageData for LOG_DATA_DATA {
17709 type Message = MavMessage;
17710 const ID: u32 = 120u32;
17711 const NAME: &'static str = "LOG_DATA";
17712 const EXTRA_CRC: u8 = 134u8;
17713 const ENCODED_LEN: usize = 97usize;
17714 fn deser(
17715 _version: MavlinkVersion,
17716 __input: &[u8],
17717 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17718 let avail_len = __input.len();
17719 let mut payload_buf = [0; Self::ENCODED_LEN];
17720 let mut buf = if avail_len < Self::ENCODED_LEN {
17721 payload_buf[0..avail_len].copy_from_slice(__input);
17722 Bytes::new(&payload_buf)
17723 } else {
17724 Bytes::new(__input)
17725 };
17726 let mut __struct = Self::default();
17727 __struct.ofs = buf.get_u32_le();
17728 __struct.id = buf.get_u16_le();
17729 __struct.count = buf.get_u8();
17730 for v in &mut __struct.data {
17731 let val = buf.get_u8();
17732 *v = val;
17733 }
17734 Ok(__struct)
17735 }
17736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17737 let mut __tmp = BytesMut::new(bytes);
17738 #[allow(clippy::absurd_extreme_comparisons)]
17739 #[allow(unused_comparisons)]
17740 if __tmp.remaining() < Self::ENCODED_LEN {
17741 panic!(
17742 "buffer is too small (need {} bytes, but got {})",
17743 Self::ENCODED_LEN,
17744 __tmp.remaining(),
17745 )
17746 }
17747 __tmp.put_u32_le(self.ofs);
17748 __tmp.put_u16_le(self.id);
17749 __tmp.put_u8(self.count);
17750 for val in &self.data {
17751 __tmp.put_u8(*val);
17752 }
17753 if matches!(version, MavlinkVersion::V2) {
17754 let len = __tmp.len();
17755 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17756 } else {
17757 __tmp.len()
17758 }
17759 }
17760}
17761#[doc = "id: 118"]
17762#[doc = "Reply to LOG_REQUEST_LIST."]
17763#[derive(Debug, Clone, PartialEq)]
17764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17766pub struct LOG_ENTRY_DATA {
17767 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
17768 pub time_utc: u32,
17769 #[doc = "Size of the log (may be approximate)"]
17770 pub size: u32,
17771 #[doc = "Log id"]
17772 pub id: u16,
17773 #[doc = "Total number of logs"]
17774 pub num_logs: u16,
17775 #[doc = "High log number"]
17776 pub last_log_num: u16,
17777}
17778impl LOG_ENTRY_DATA {
17779 pub const ENCODED_LEN: usize = 14usize;
17780 pub const DEFAULT: Self = Self {
17781 time_utc: 0_u32,
17782 size: 0_u32,
17783 id: 0_u16,
17784 num_logs: 0_u16,
17785 last_log_num: 0_u16,
17786 };
17787 #[cfg(feature = "arbitrary")]
17788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17789 use arbitrary::{Arbitrary, Unstructured};
17790 let mut buf = [0u8; 1024];
17791 rng.fill_bytes(&mut buf);
17792 let mut unstructured = Unstructured::new(&buf);
17793 Self::arbitrary(&mut unstructured).unwrap_or_default()
17794 }
17795}
17796impl Default for LOG_ENTRY_DATA {
17797 fn default() -> Self {
17798 Self::DEFAULT.clone()
17799 }
17800}
17801impl MessageData for LOG_ENTRY_DATA {
17802 type Message = MavMessage;
17803 const ID: u32 = 118u32;
17804 const NAME: &'static str = "LOG_ENTRY";
17805 const EXTRA_CRC: u8 = 56u8;
17806 const ENCODED_LEN: usize = 14usize;
17807 fn deser(
17808 _version: MavlinkVersion,
17809 __input: &[u8],
17810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17811 let avail_len = __input.len();
17812 let mut payload_buf = [0; Self::ENCODED_LEN];
17813 let mut buf = if avail_len < Self::ENCODED_LEN {
17814 payload_buf[0..avail_len].copy_from_slice(__input);
17815 Bytes::new(&payload_buf)
17816 } else {
17817 Bytes::new(__input)
17818 };
17819 let mut __struct = Self::default();
17820 __struct.time_utc = buf.get_u32_le();
17821 __struct.size = buf.get_u32_le();
17822 __struct.id = buf.get_u16_le();
17823 __struct.num_logs = buf.get_u16_le();
17824 __struct.last_log_num = buf.get_u16_le();
17825 Ok(__struct)
17826 }
17827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17828 let mut __tmp = BytesMut::new(bytes);
17829 #[allow(clippy::absurd_extreme_comparisons)]
17830 #[allow(unused_comparisons)]
17831 if __tmp.remaining() < Self::ENCODED_LEN {
17832 panic!(
17833 "buffer is too small (need {} bytes, but got {})",
17834 Self::ENCODED_LEN,
17835 __tmp.remaining(),
17836 )
17837 }
17838 __tmp.put_u32_le(self.time_utc);
17839 __tmp.put_u32_le(self.size);
17840 __tmp.put_u16_le(self.id);
17841 __tmp.put_u16_le(self.num_logs);
17842 __tmp.put_u16_le(self.last_log_num);
17843 if matches!(version, MavlinkVersion::V2) {
17844 let len = __tmp.len();
17845 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17846 } else {
17847 __tmp.len()
17848 }
17849 }
17850}
17851#[doc = "id: 121"]
17852#[doc = "Erase all logs."]
17853#[derive(Debug, Clone, PartialEq)]
17854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17856pub struct LOG_ERASE_DATA {
17857 #[doc = "System ID"]
17858 pub target_system: u8,
17859 #[doc = "Component ID"]
17860 pub target_component: u8,
17861}
17862impl LOG_ERASE_DATA {
17863 pub const ENCODED_LEN: usize = 2usize;
17864 pub const DEFAULT: Self = Self {
17865 target_system: 0_u8,
17866 target_component: 0_u8,
17867 };
17868 #[cfg(feature = "arbitrary")]
17869 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17870 use arbitrary::{Arbitrary, Unstructured};
17871 let mut buf = [0u8; 1024];
17872 rng.fill_bytes(&mut buf);
17873 let mut unstructured = Unstructured::new(&buf);
17874 Self::arbitrary(&mut unstructured).unwrap_or_default()
17875 }
17876}
17877impl Default for LOG_ERASE_DATA {
17878 fn default() -> Self {
17879 Self::DEFAULT.clone()
17880 }
17881}
17882impl MessageData for LOG_ERASE_DATA {
17883 type Message = MavMessage;
17884 const ID: u32 = 121u32;
17885 const NAME: &'static str = "LOG_ERASE";
17886 const EXTRA_CRC: u8 = 237u8;
17887 const ENCODED_LEN: usize = 2usize;
17888 fn deser(
17889 _version: MavlinkVersion,
17890 __input: &[u8],
17891 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17892 let avail_len = __input.len();
17893 let mut payload_buf = [0; Self::ENCODED_LEN];
17894 let mut buf = if avail_len < Self::ENCODED_LEN {
17895 payload_buf[0..avail_len].copy_from_slice(__input);
17896 Bytes::new(&payload_buf)
17897 } else {
17898 Bytes::new(__input)
17899 };
17900 let mut __struct = Self::default();
17901 __struct.target_system = buf.get_u8();
17902 __struct.target_component = buf.get_u8();
17903 Ok(__struct)
17904 }
17905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17906 let mut __tmp = BytesMut::new(bytes);
17907 #[allow(clippy::absurd_extreme_comparisons)]
17908 #[allow(unused_comparisons)]
17909 if __tmp.remaining() < Self::ENCODED_LEN {
17910 panic!(
17911 "buffer is too small (need {} bytes, but got {})",
17912 Self::ENCODED_LEN,
17913 __tmp.remaining(),
17914 )
17915 }
17916 __tmp.put_u8(self.target_system);
17917 __tmp.put_u8(self.target_component);
17918 if matches!(version, MavlinkVersion::V2) {
17919 let len = __tmp.len();
17920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17921 } else {
17922 __tmp.len()
17923 }
17924 }
17925}
17926#[doc = "id: 119"]
17927#[doc = "Request a chunk of a log."]
17928#[derive(Debug, Clone, PartialEq)]
17929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17931pub struct LOG_REQUEST_DATA_DATA {
17932 #[doc = "Offset into the log"]
17933 pub ofs: u32,
17934 #[doc = "Number of bytes"]
17935 pub count: u32,
17936 #[doc = "Log id (from LOG_ENTRY reply)"]
17937 pub id: u16,
17938 #[doc = "System ID"]
17939 pub target_system: u8,
17940 #[doc = "Component ID"]
17941 pub target_component: u8,
17942}
17943impl LOG_REQUEST_DATA_DATA {
17944 pub const ENCODED_LEN: usize = 12usize;
17945 pub const DEFAULT: Self = Self {
17946 ofs: 0_u32,
17947 count: 0_u32,
17948 id: 0_u16,
17949 target_system: 0_u8,
17950 target_component: 0_u8,
17951 };
17952 #[cfg(feature = "arbitrary")]
17953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17954 use arbitrary::{Arbitrary, Unstructured};
17955 let mut buf = [0u8; 1024];
17956 rng.fill_bytes(&mut buf);
17957 let mut unstructured = Unstructured::new(&buf);
17958 Self::arbitrary(&mut unstructured).unwrap_or_default()
17959 }
17960}
17961impl Default for LOG_REQUEST_DATA_DATA {
17962 fn default() -> Self {
17963 Self::DEFAULT.clone()
17964 }
17965}
17966impl MessageData for LOG_REQUEST_DATA_DATA {
17967 type Message = MavMessage;
17968 const ID: u32 = 119u32;
17969 const NAME: &'static str = "LOG_REQUEST_DATA";
17970 const EXTRA_CRC: u8 = 116u8;
17971 const ENCODED_LEN: usize = 12usize;
17972 fn deser(
17973 _version: MavlinkVersion,
17974 __input: &[u8],
17975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17976 let avail_len = __input.len();
17977 let mut payload_buf = [0; Self::ENCODED_LEN];
17978 let mut buf = if avail_len < Self::ENCODED_LEN {
17979 payload_buf[0..avail_len].copy_from_slice(__input);
17980 Bytes::new(&payload_buf)
17981 } else {
17982 Bytes::new(__input)
17983 };
17984 let mut __struct = Self::default();
17985 __struct.ofs = buf.get_u32_le();
17986 __struct.count = buf.get_u32_le();
17987 __struct.id = buf.get_u16_le();
17988 __struct.target_system = buf.get_u8();
17989 __struct.target_component = buf.get_u8();
17990 Ok(__struct)
17991 }
17992 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17993 let mut __tmp = BytesMut::new(bytes);
17994 #[allow(clippy::absurd_extreme_comparisons)]
17995 #[allow(unused_comparisons)]
17996 if __tmp.remaining() < Self::ENCODED_LEN {
17997 panic!(
17998 "buffer is too small (need {} bytes, but got {})",
17999 Self::ENCODED_LEN,
18000 __tmp.remaining(),
18001 )
18002 }
18003 __tmp.put_u32_le(self.ofs);
18004 __tmp.put_u32_le(self.count);
18005 __tmp.put_u16_le(self.id);
18006 __tmp.put_u8(self.target_system);
18007 __tmp.put_u8(self.target_component);
18008 if matches!(version, MavlinkVersion::V2) {
18009 let len = __tmp.len();
18010 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18011 } else {
18012 __tmp.len()
18013 }
18014 }
18015}
18016#[doc = "id: 122"]
18017#[doc = "Stop log transfer and resume normal logging."]
18018#[derive(Debug, Clone, PartialEq)]
18019#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18020#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18021pub struct LOG_REQUEST_END_DATA {
18022 #[doc = "System ID"]
18023 pub target_system: u8,
18024 #[doc = "Component ID"]
18025 pub target_component: u8,
18026}
18027impl LOG_REQUEST_END_DATA {
18028 pub const ENCODED_LEN: usize = 2usize;
18029 pub const DEFAULT: Self = Self {
18030 target_system: 0_u8,
18031 target_component: 0_u8,
18032 };
18033 #[cfg(feature = "arbitrary")]
18034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18035 use arbitrary::{Arbitrary, Unstructured};
18036 let mut buf = [0u8; 1024];
18037 rng.fill_bytes(&mut buf);
18038 let mut unstructured = Unstructured::new(&buf);
18039 Self::arbitrary(&mut unstructured).unwrap_or_default()
18040 }
18041}
18042impl Default for LOG_REQUEST_END_DATA {
18043 fn default() -> Self {
18044 Self::DEFAULT.clone()
18045 }
18046}
18047impl MessageData for LOG_REQUEST_END_DATA {
18048 type Message = MavMessage;
18049 const ID: u32 = 122u32;
18050 const NAME: &'static str = "LOG_REQUEST_END";
18051 const EXTRA_CRC: u8 = 203u8;
18052 const ENCODED_LEN: usize = 2usize;
18053 fn deser(
18054 _version: MavlinkVersion,
18055 __input: &[u8],
18056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18057 let avail_len = __input.len();
18058 let mut payload_buf = [0; Self::ENCODED_LEN];
18059 let mut buf = if avail_len < Self::ENCODED_LEN {
18060 payload_buf[0..avail_len].copy_from_slice(__input);
18061 Bytes::new(&payload_buf)
18062 } else {
18063 Bytes::new(__input)
18064 };
18065 let mut __struct = Self::default();
18066 __struct.target_system = buf.get_u8();
18067 __struct.target_component = buf.get_u8();
18068 Ok(__struct)
18069 }
18070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18071 let mut __tmp = BytesMut::new(bytes);
18072 #[allow(clippy::absurd_extreme_comparisons)]
18073 #[allow(unused_comparisons)]
18074 if __tmp.remaining() < Self::ENCODED_LEN {
18075 panic!(
18076 "buffer is too small (need {} bytes, but got {})",
18077 Self::ENCODED_LEN,
18078 __tmp.remaining(),
18079 )
18080 }
18081 __tmp.put_u8(self.target_system);
18082 __tmp.put_u8(self.target_component);
18083 if matches!(version, MavlinkVersion::V2) {
18084 let len = __tmp.len();
18085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18086 } else {
18087 __tmp.len()
18088 }
18089 }
18090}
18091#[doc = "id: 117"]
18092#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18093#[derive(Debug, Clone, PartialEq)]
18094#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18095#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18096pub struct LOG_REQUEST_LIST_DATA {
18097 #[doc = "First log id (0 for first available)"]
18098 pub start: u16,
18099 #[doc = "Last log id (0xffff for last available)"]
18100 pub end: u16,
18101 #[doc = "System ID"]
18102 pub target_system: u8,
18103 #[doc = "Component ID"]
18104 pub target_component: u8,
18105}
18106impl LOG_REQUEST_LIST_DATA {
18107 pub const ENCODED_LEN: usize = 6usize;
18108 pub const DEFAULT: Self = Self {
18109 start: 0_u16,
18110 end: 0_u16,
18111 target_system: 0_u8,
18112 target_component: 0_u8,
18113 };
18114 #[cfg(feature = "arbitrary")]
18115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18116 use arbitrary::{Arbitrary, Unstructured};
18117 let mut buf = [0u8; 1024];
18118 rng.fill_bytes(&mut buf);
18119 let mut unstructured = Unstructured::new(&buf);
18120 Self::arbitrary(&mut unstructured).unwrap_or_default()
18121 }
18122}
18123impl Default for LOG_REQUEST_LIST_DATA {
18124 fn default() -> Self {
18125 Self::DEFAULT.clone()
18126 }
18127}
18128impl MessageData for LOG_REQUEST_LIST_DATA {
18129 type Message = MavMessage;
18130 const ID: u32 = 117u32;
18131 const NAME: &'static str = "LOG_REQUEST_LIST";
18132 const EXTRA_CRC: u8 = 128u8;
18133 const ENCODED_LEN: usize = 6usize;
18134 fn deser(
18135 _version: MavlinkVersion,
18136 __input: &[u8],
18137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18138 let avail_len = __input.len();
18139 let mut payload_buf = [0; Self::ENCODED_LEN];
18140 let mut buf = if avail_len < Self::ENCODED_LEN {
18141 payload_buf[0..avail_len].copy_from_slice(__input);
18142 Bytes::new(&payload_buf)
18143 } else {
18144 Bytes::new(__input)
18145 };
18146 let mut __struct = Self::default();
18147 __struct.start = buf.get_u16_le();
18148 __struct.end = buf.get_u16_le();
18149 __struct.target_system = buf.get_u8();
18150 __struct.target_component = buf.get_u8();
18151 Ok(__struct)
18152 }
18153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18154 let mut __tmp = BytesMut::new(bytes);
18155 #[allow(clippy::absurd_extreme_comparisons)]
18156 #[allow(unused_comparisons)]
18157 if __tmp.remaining() < Self::ENCODED_LEN {
18158 panic!(
18159 "buffer is too small (need {} bytes, but got {})",
18160 Self::ENCODED_LEN,
18161 __tmp.remaining(),
18162 )
18163 }
18164 __tmp.put_u16_le(self.start);
18165 __tmp.put_u16_le(self.end);
18166 __tmp.put_u8(self.target_system);
18167 __tmp.put_u8(self.target_component);
18168 if matches!(version, MavlinkVersion::V2) {
18169 let len = __tmp.len();
18170 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18171 } else {
18172 __tmp.len()
18173 }
18174 }
18175}
18176#[doc = "id: 192"]
18177#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18178#[derive(Debug, Clone, PartialEq)]
18179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18180#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18181pub struct MAG_CAL_REPORT_DATA {
18182 #[doc = "RMS milligauss residuals."]
18183 pub fitness: f32,
18184 #[doc = "X offset."]
18185 pub ofs_x: f32,
18186 #[doc = "Y offset."]
18187 pub ofs_y: f32,
18188 #[doc = "Z offset."]
18189 pub ofs_z: f32,
18190 #[doc = "X diagonal (matrix 11)."]
18191 pub diag_x: f32,
18192 #[doc = "Y diagonal (matrix 22)."]
18193 pub diag_y: f32,
18194 #[doc = "Z diagonal (matrix 33)."]
18195 pub diag_z: f32,
18196 #[doc = "X off-diagonal (matrix 12 and 21)."]
18197 pub offdiag_x: f32,
18198 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18199 pub offdiag_y: f32,
18200 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18201 pub offdiag_z: f32,
18202 #[doc = "Compass being calibrated."]
18203 pub compass_id: u8,
18204 #[doc = "Bitmask of compasses being calibrated."]
18205 pub cal_mask: u8,
18206 #[doc = "Calibration Status."]
18207 pub cal_status: MagCalStatus,
18208 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18209 pub autosaved: u8,
18210 #[doc = "Confidence in orientation (higher is better)."]
18211 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18212 pub orientation_confidence: f32,
18213 #[doc = "orientation before calibration."]
18214 #[cfg_attr(feature = "serde", serde(default))]
18215 pub old_orientation: MavSensorOrientation,
18216 #[doc = "orientation after calibration."]
18217 #[cfg_attr(feature = "serde", serde(default))]
18218 pub new_orientation: MavSensorOrientation,
18219 #[doc = "field radius correction factor"]
18220 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18221 pub scale_factor: f32,
18222}
18223impl MAG_CAL_REPORT_DATA {
18224 pub const ENCODED_LEN: usize = 54usize;
18225 pub const DEFAULT: Self = Self {
18226 fitness: 0.0_f32,
18227 ofs_x: 0.0_f32,
18228 ofs_y: 0.0_f32,
18229 ofs_z: 0.0_f32,
18230 diag_x: 0.0_f32,
18231 diag_y: 0.0_f32,
18232 diag_z: 0.0_f32,
18233 offdiag_x: 0.0_f32,
18234 offdiag_y: 0.0_f32,
18235 offdiag_z: 0.0_f32,
18236 compass_id: 0_u8,
18237 cal_mask: 0_u8,
18238 cal_status: MagCalStatus::DEFAULT,
18239 autosaved: 0_u8,
18240 orientation_confidence: 0.0_f32,
18241 old_orientation: MavSensorOrientation::DEFAULT,
18242 new_orientation: MavSensorOrientation::DEFAULT,
18243 scale_factor: 0.0_f32,
18244 };
18245 #[cfg(feature = "arbitrary")]
18246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18247 use arbitrary::{Arbitrary, Unstructured};
18248 let mut buf = [0u8; 1024];
18249 rng.fill_bytes(&mut buf);
18250 let mut unstructured = Unstructured::new(&buf);
18251 Self::arbitrary(&mut unstructured).unwrap_or_default()
18252 }
18253}
18254impl Default for MAG_CAL_REPORT_DATA {
18255 fn default() -> Self {
18256 Self::DEFAULT.clone()
18257 }
18258}
18259impl MessageData for MAG_CAL_REPORT_DATA {
18260 type Message = MavMessage;
18261 const ID: u32 = 192u32;
18262 const NAME: &'static str = "MAG_CAL_REPORT";
18263 const EXTRA_CRC: u8 = 36u8;
18264 const ENCODED_LEN: usize = 54usize;
18265 fn deser(
18266 _version: MavlinkVersion,
18267 __input: &[u8],
18268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18269 let avail_len = __input.len();
18270 let mut payload_buf = [0; Self::ENCODED_LEN];
18271 let mut buf = if avail_len < Self::ENCODED_LEN {
18272 payload_buf[0..avail_len].copy_from_slice(__input);
18273 Bytes::new(&payload_buf)
18274 } else {
18275 Bytes::new(__input)
18276 };
18277 let mut __struct = Self::default();
18278 __struct.fitness = buf.get_f32_le();
18279 __struct.ofs_x = buf.get_f32_le();
18280 __struct.ofs_y = buf.get_f32_le();
18281 __struct.ofs_z = buf.get_f32_le();
18282 __struct.diag_x = buf.get_f32_le();
18283 __struct.diag_y = buf.get_f32_le();
18284 __struct.diag_z = buf.get_f32_le();
18285 __struct.offdiag_x = buf.get_f32_le();
18286 __struct.offdiag_y = buf.get_f32_le();
18287 __struct.offdiag_z = buf.get_f32_le();
18288 __struct.compass_id = buf.get_u8();
18289 __struct.cal_mask = buf.get_u8();
18290 let tmp = buf.get_u8();
18291 __struct.cal_status =
18292 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18293 enum_type: "MagCalStatus",
18294 value: tmp as u32,
18295 })?;
18296 __struct.autosaved = buf.get_u8();
18297 __struct.orientation_confidence = buf.get_f32_le();
18298 let tmp = buf.get_u8();
18299 __struct.old_orientation =
18300 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18301 enum_type: "MavSensorOrientation",
18302 value: tmp as u32,
18303 })?;
18304 let tmp = buf.get_u8();
18305 __struct.new_orientation =
18306 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18307 enum_type: "MavSensorOrientation",
18308 value: tmp as u32,
18309 })?;
18310 __struct.scale_factor = buf.get_f32_le();
18311 Ok(__struct)
18312 }
18313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18314 let mut __tmp = BytesMut::new(bytes);
18315 #[allow(clippy::absurd_extreme_comparisons)]
18316 #[allow(unused_comparisons)]
18317 if __tmp.remaining() < Self::ENCODED_LEN {
18318 panic!(
18319 "buffer is too small (need {} bytes, but got {})",
18320 Self::ENCODED_LEN,
18321 __tmp.remaining(),
18322 )
18323 }
18324 __tmp.put_f32_le(self.fitness);
18325 __tmp.put_f32_le(self.ofs_x);
18326 __tmp.put_f32_le(self.ofs_y);
18327 __tmp.put_f32_le(self.ofs_z);
18328 __tmp.put_f32_le(self.diag_x);
18329 __tmp.put_f32_le(self.diag_y);
18330 __tmp.put_f32_le(self.diag_z);
18331 __tmp.put_f32_le(self.offdiag_x);
18332 __tmp.put_f32_le(self.offdiag_y);
18333 __tmp.put_f32_le(self.offdiag_z);
18334 __tmp.put_u8(self.compass_id);
18335 __tmp.put_u8(self.cal_mask);
18336 __tmp.put_u8(self.cal_status as u8);
18337 __tmp.put_u8(self.autosaved);
18338 __tmp.put_f32_le(self.orientation_confidence);
18339 __tmp.put_u8(self.old_orientation as u8);
18340 __tmp.put_u8(self.new_orientation as u8);
18341 __tmp.put_f32_le(self.scale_factor);
18342 if matches!(version, MavlinkVersion::V2) {
18343 let len = __tmp.len();
18344 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18345 } else {
18346 __tmp.len()
18347 }
18348 }
18349}
18350#[doc = "id: 69"]
18351#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18352#[derive(Debug, Clone, PartialEq)]
18353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18355pub struct MANUAL_CONTROL_DATA {
18356 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18357 pub x: i16,
18358 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18359 pub y: i16,
18360 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18361 pub z: i16,
18362 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18363 pub r: i16,
18364 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18365 pub buttons: u16,
18366 #[doc = "The system to be controlled."]
18367 pub target: u8,
18368 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18369 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18370 pub buttons2: u16,
18371 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18372 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18373 pub enabled_extensions: u8,
18374 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18375 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18376 pub s: i16,
18377 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18378 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18379 pub t: i16,
18380 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18381 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18382 pub aux1: i16,
18383 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18384 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18385 pub aux2: i16,
18386 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18387 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18388 pub aux3: i16,
18389 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18390 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18391 pub aux4: i16,
18392 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18393 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18394 pub aux5: i16,
18395 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18396 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18397 pub aux6: i16,
18398}
18399impl MANUAL_CONTROL_DATA {
18400 pub const ENCODED_LEN: usize = 30usize;
18401 pub const DEFAULT: Self = Self {
18402 x: 0_i16,
18403 y: 0_i16,
18404 z: 0_i16,
18405 r: 0_i16,
18406 buttons: 0_u16,
18407 target: 0_u8,
18408 buttons2: 0_u16,
18409 enabled_extensions: 0_u8,
18410 s: 0_i16,
18411 t: 0_i16,
18412 aux1: 0_i16,
18413 aux2: 0_i16,
18414 aux3: 0_i16,
18415 aux4: 0_i16,
18416 aux5: 0_i16,
18417 aux6: 0_i16,
18418 };
18419 #[cfg(feature = "arbitrary")]
18420 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18421 use arbitrary::{Arbitrary, Unstructured};
18422 let mut buf = [0u8; 1024];
18423 rng.fill_bytes(&mut buf);
18424 let mut unstructured = Unstructured::new(&buf);
18425 Self::arbitrary(&mut unstructured).unwrap_or_default()
18426 }
18427}
18428impl Default for MANUAL_CONTROL_DATA {
18429 fn default() -> Self {
18430 Self::DEFAULT.clone()
18431 }
18432}
18433impl MessageData for MANUAL_CONTROL_DATA {
18434 type Message = MavMessage;
18435 const ID: u32 = 69u32;
18436 const NAME: &'static str = "MANUAL_CONTROL";
18437 const EXTRA_CRC: u8 = 243u8;
18438 const ENCODED_LEN: usize = 30usize;
18439 fn deser(
18440 _version: MavlinkVersion,
18441 __input: &[u8],
18442 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18443 let avail_len = __input.len();
18444 let mut payload_buf = [0; Self::ENCODED_LEN];
18445 let mut buf = if avail_len < Self::ENCODED_LEN {
18446 payload_buf[0..avail_len].copy_from_slice(__input);
18447 Bytes::new(&payload_buf)
18448 } else {
18449 Bytes::new(__input)
18450 };
18451 let mut __struct = Self::default();
18452 __struct.x = buf.get_i16_le();
18453 __struct.y = buf.get_i16_le();
18454 __struct.z = buf.get_i16_le();
18455 __struct.r = buf.get_i16_le();
18456 __struct.buttons = buf.get_u16_le();
18457 __struct.target = buf.get_u8();
18458 __struct.buttons2 = buf.get_u16_le();
18459 __struct.enabled_extensions = buf.get_u8();
18460 __struct.s = buf.get_i16_le();
18461 __struct.t = buf.get_i16_le();
18462 __struct.aux1 = buf.get_i16_le();
18463 __struct.aux2 = buf.get_i16_le();
18464 __struct.aux3 = buf.get_i16_le();
18465 __struct.aux4 = buf.get_i16_le();
18466 __struct.aux5 = buf.get_i16_le();
18467 __struct.aux6 = buf.get_i16_le();
18468 Ok(__struct)
18469 }
18470 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18471 let mut __tmp = BytesMut::new(bytes);
18472 #[allow(clippy::absurd_extreme_comparisons)]
18473 #[allow(unused_comparisons)]
18474 if __tmp.remaining() < Self::ENCODED_LEN {
18475 panic!(
18476 "buffer is too small (need {} bytes, but got {})",
18477 Self::ENCODED_LEN,
18478 __tmp.remaining(),
18479 )
18480 }
18481 __tmp.put_i16_le(self.x);
18482 __tmp.put_i16_le(self.y);
18483 __tmp.put_i16_le(self.z);
18484 __tmp.put_i16_le(self.r);
18485 __tmp.put_u16_le(self.buttons);
18486 __tmp.put_u8(self.target);
18487 __tmp.put_u16_le(self.buttons2);
18488 __tmp.put_u8(self.enabled_extensions);
18489 __tmp.put_i16_le(self.s);
18490 __tmp.put_i16_le(self.t);
18491 __tmp.put_i16_le(self.aux1);
18492 __tmp.put_i16_le(self.aux2);
18493 __tmp.put_i16_le(self.aux3);
18494 __tmp.put_i16_le(self.aux4);
18495 __tmp.put_i16_le(self.aux5);
18496 __tmp.put_i16_le(self.aux6);
18497 if matches!(version, MavlinkVersion::V2) {
18498 let len = __tmp.len();
18499 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18500 } else {
18501 __tmp.len()
18502 }
18503 }
18504}
18505#[doc = "id: 81"]
18506#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18507#[derive(Debug, Clone, PartialEq)]
18508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18510pub struct MANUAL_SETPOINT_DATA {
18511 #[doc = "Timestamp (time since system boot)."]
18512 pub time_boot_ms: u32,
18513 #[doc = "Desired roll rate"]
18514 pub roll: f32,
18515 #[doc = "Desired pitch rate"]
18516 pub pitch: f32,
18517 #[doc = "Desired yaw rate"]
18518 pub yaw: f32,
18519 #[doc = "Collective thrust, normalized to 0 .. 1"]
18520 pub thrust: f32,
18521 #[doc = "Flight mode switch position, 0.. 255"]
18522 pub mode_switch: u8,
18523 #[doc = "Override mode switch position, 0.. 255"]
18524 pub manual_override_switch: u8,
18525}
18526impl MANUAL_SETPOINT_DATA {
18527 pub const ENCODED_LEN: usize = 22usize;
18528 pub const DEFAULT: Self = Self {
18529 time_boot_ms: 0_u32,
18530 roll: 0.0_f32,
18531 pitch: 0.0_f32,
18532 yaw: 0.0_f32,
18533 thrust: 0.0_f32,
18534 mode_switch: 0_u8,
18535 manual_override_switch: 0_u8,
18536 };
18537 #[cfg(feature = "arbitrary")]
18538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18539 use arbitrary::{Arbitrary, Unstructured};
18540 let mut buf = [0u8; 1024];
18541 rng.fill_bytes(&mut buf);
18542 let mut unstructured = Unstructured::new(&buf);
18543 Self::arbitrary(&mut unstructured).unwrap_or_default()
18544 }
18545}
18546impl Default for MANUAL_SETPOINT_DATA {
18547 fn default() -> Self {
18548 Self::DEFAULT.clone()
18549 }
18550}
18551impl MessageData for MANUAL_SETPOINT_DATA {
18552 type Message = MavMessage;
18553 const ID: u32 = 81u32;
18554 const NAME: &'static str = "MANUAL_SETPOINT";
18555 const EXTRA_CRC: u8 = 106u8;
18556 const ENCODED_LEN: usize = 22usize;
18557 fn deser(
18558 _version: MavlinkVersion,
18559 __input: &[u8],
18560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18561 let avail_len = __input.len();
18562 let mut payload_buf = [0; Self::ENCODED_LEN];
18563 let mut buf = if avail_len < Self::ENCODED_LEN {
18564 payload_buf[0..avail_len].copy_from_slice(__input);
18565 Bytes::new(&payload_buf)
18566 } else {
18567 Bytes::new(__input)
18568 };
18569 let mut __struct = Self::default();
18570 __struct.time_boot_ms = buf.get_u32_le();
18571 __struct.roll = buf.get_f32_le();
18572 __struct.pitch = buf.get_f32_le();
18573 __struct.yaw = buf.get_f32_le();
18574 __struct.thrust = buf.get_f32_le();
18575 __struct.mode_switch = buf.get_u8();
18576 __struct.manual_override_switch = buf.get_u8();
18577 Ok(__struct)
18578 }
18579 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18580 let mut __tmp = BytesMut::new(bytes);
18581 #[allow(clippy::absurd_extreme_comparisons)]
18582 #[allow(unused_comparisons)]
18583 if __tmp.remaining() < Self::ENCODED_LEN {
18584 panic!(
18585 "buffer is too small (need {} bytes, but got {})",
18586 Self::ENCODED_LEN,
18587 __tmp.remaining(),
18588 )
18589 }
18590 __tmp.put_u32_le(self.time_boot_ms);
18591 __tmp.put_f32_le(self.roll);
18592 __tmp.put_f32_le(self.pitch);
18593 __tmp.put_f32_le(self.yaw);
18594 __tmp.put_f32_le(self.thrust);
18595 __tmp.put_u8(self.mode_switch);
18596 __tmp.put_u8(self.manual_override_switch);
18597 if matches!(version, MavlinkVersion::V2) {
18598 let len = __tmp.len();
18599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18600 } else {
18601 __tmp.len()
18602 }
18603 }
18604}
18605#[doc = "id: 249"]
18606#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18607#[derive(Debug, Clone, PartialEq)]
18608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18610pub struct MEMORY_VECT_DATA {
18611 #[doc = "Starting address of the debug variables"]
18612 pub address: u16,
18613 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18614 pub ver: u8,
18615 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18616 pub mavtype: u8,
18617 #[doc = "Memory contents at specified address"]
18618 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18619 pub value: [i8; 32],
18620}
18621impl MEMORY_VECT_DATA {
18622 pub const ENCODED_LEN: usize = 36usize;
18623 pub const DEFAULT: Self = Self {
18624 address: 0_u16,
18625 ver: 0_u8,
18626 mavtype: 0_u8,
18627 value: [0_i8; 32usize],
18628 };
18629 #[cfg(feature = "arbitrary")]
18630 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18631 use arbitrary::{Arbitrary, Unstructured};
18632 let mut buf = [0u8; 1024];
18633 rng.fill_bytes(&mut buf);
18634 let mut unstructured = Unstructured::new(&buf);
18635 Self::arbitrary(&mut unstructured).unwrap_or_default()
18636 }
18637}
18638impl Default for MEMORY_VECT_DATA {
18639 fn default() -> Self {
18640 Self::DEFAULT.clone()
18641 }
18642}
18643impl MessageData for MEMORY_VECT_DATA {
18644 type Message = MavMessage;
18645 const ID: u32 = 249u32;
18646 const NAME: &'static str = "MEMORY_VECT";
18647 const EXTRA_CRC: u8 = 204u8;
18648 const ENCODED_LEN: usize = 36usize;
18649 fn deser(
18650 _version: MavlinkVersion,
18651 __input: &[u8],
18652 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18653 let avail_len = __input.len();
18654 let mut payload_buf = [0; Self::ENCODED_LEN];
18655 let mut buf = if avail_len < Self::ENCODED_LEN {
18656 payload_buf[0..avail_len].copy_from_slice(__input);
18657 Bytes::new(&payload_buf)
18658 } else {
18659 Bytes::new(__input)
18660 };
18661 let mut __struct = Self::default();
18662 __struct.address = buf.get_u16_le();
18663 __struct.ver = buf.get_u8();
18664 __struct.mavtype = buf.get_u8();
18665 for v in &mut __struct.value {
18666 let val = buf.get_i8();
18667 *v = val;
18668 }
18669 Ok(__struct)
18670 }
18671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18672 let mut __tmp = BytesMut::new(bytes);
18673 #[allow(clippy::absurd_extreme_comparisons)]
18674 #[allow(unused_comparisons)]
18675 if __tmp.remaining() < Self::ENCODED_LEN {
18676 panic!(
18677 "buffer is too small (need {} bytes, but got {})",
18678 Self::ENCODED_LEN,
18679 __tmp.remaining(),
18680 )
18681 }
18682 __tmp.put_u16_le(self.address);
18683 __tmp.put_u8(self.ver);
18684 __tmp.put_u8(self.mavtype);
18685 for val in &self.value {
18686 __tmp.put_i8(*val);
18687 }
18688 if matches!(version, MavlinkVersion::V2) {
18689 let len = __tmp.len();
18690 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18691 } else {
18692 __tmp.len()
18693 }
18694 }
18695}
18696#[doc = "id: 244"]
18697#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18698#[derive(Debug, Clone, PartialEq)]
18699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18700#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18701pub struct MESSAGE_INTERVAL_DATA {
18702 #[doc = "0 indicates the interval at which it is sent."]
18703 pub interval_us: i32,
18704 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18705 pub message_id: u16,
18706}
18707impl MESSAGE_INTERVAL_DATA {
18708 pub const ENCODED_LEN: usize = 6usize;
18709 pub const DEFAULT: Self = Self {
18710 interval_us: 0_i32,
18711 message_id: 0_u16,
18712 };
18713 #[cfg(feature = "arbitrary")]
18714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18715 use arbitrary::{Arbitrary, Unstructured};
18716 let mut buf = [0u8; 1024];
18717 rng.fill_bytes(&mut buf);
18718 let mut unstructured = Unstructured::new(&buf);
18719 Self::arbitrary(&mut unstructured).unwrap_or_default()
18720 }
18721}
18722impl Default for MESSAGE_INTERVAL_DATA {
18723 fn default() -> Self {
18724 Self::DEFAULT.clone()
18725 }
18726}
18727impl MessageData for MESSAGE_INTERVAL_DATA {
18728 type Message = MavMessage;
18729 const ID: u32 = 244u32;
18730 const NAME: &'static str = "MESSAGE_INTERVAL";
18731 const EXTRA_CRC: u8 = 95u8;
18732 const ENCODED_LEN: usize = 6usize;
18733 fn deser(
18734 _version: MavlinkVersion,
18735 __input: &[u8],
18736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18737 let avail_len = __input.len();
18738 let mut payload_buf = [0; Self::ENCODED_LEN];
18739 let mut buf = if avail_len < Self::ENCODED_LEN {
18740 payload_buf[0..avail_len].copy_from_slice(__input);
18741 Bytes::new(&payload_buf)
18742 } else {
18743 Bytes::new(__input)
18744 };
18745 let mut __struct = Self::default();
18746 __struct.interval_us = buf.get_i32_le();
18747 __struct.message_id = buf.get_u16_le();
18748 Ok(__struct)
18749 }
18750 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18751 let mut __tmp = BytesMut::new(bytes);
18752 #[allow(clippy::absurd_extreme_comparisons)]
18753 #[allow(unused_comparisons)]
18754 if __tmp.remaining() < Self::ENCODED_LEN {
18755 panic!(
18756 "buffer is too small (need {} bytes, but got {})",
18757 Self::ENCODED_LEN,
18758 __tmp.remaining(),
18759 )
18760 }
18761 __tmp.put_i32_le(self.interval_us);
18762 __tmp.put_u16_le(self.message_id);
18763 if matches!(version, MavlinkVersion::V2) {
18764 let len = __tmp.len();
18765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18766 } else {
18767 __tmp.len()
18768 }
18769 }
18770}
18771#[doc = "id: 47"]
18772#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
18773#[derive(Debug, Clone, PartialEq)]
18774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18776pub struct MISSION_ACK_DATA {
18777 #[doc = "System ID"]
18778 pub target_system: u8,
18779 #[doc = "Component ID"]
18780 pub target_component: u8,
18781 #[doc = "Mission result."]
18782 pub mavtype: MavMissionResult,
18783 #[doc = "Mission type."]
18784 #[cfg_attr(feature = "serde", serde(default))]
18785 pub mission_type: MavMissionType,
18786 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
18787 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18788 pub opaque_id: u32,
18789}
18790impl MISSION_ACK_DATA {
18791 pub const ENCODED_LEN: usize = 8usize;
18792 pub const DEFAULT: Self = Self {
18793 target_system: 0_u8,
18794 target_component: 0_u8,
18795 mavtype: MavMissionResult::DEFAULT,
18796 mission_type: MavMissionType::DEFAULT,
18797 opaque_id: 0_u32,
18798 };
18799 #[cfg(feature = "arbitrary")]
18800 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18801 use arbitrary::{Arbitrary, Unstructured};
18802 let mut buf = [0u8; 1024];
18803 rng.fill_bytes(&mut buf);
18804 let mut unstructured = Unstructured::new(&buf);
18805 Self::arbitrary(&mut unstructured).unwrap_or_default()
18806 }
18807}
18808impl Default for MISSION_ACK_DATA {
18809 fn default() -> Self {
18810 Self::DEFAULT.clone()
18811 }
18812}
18813impl MessageData for MISSION_ACK_DATA {
18814 type Message = MavMessage;
18815 const ID: u32 = 47u32;
18816 const NAME: &'static str = "MISSION_ACK";
18817 const EXTRA_CRC: u8 = 153u8;
18818 const ENCODED_LEN: usize = 8usize;
18819 fn deser(
18820 _version: MavlinkVersion,
18821 __input: &[u8],
18822 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18823 let avail_len = __input.len();
18824 let mut payload_buf = [0; Self::ENCODED_LEN];
18825 let mut buf = if avail_len < Self::ENCODED_LEN {
18826 payload_buf[0..avail_len].copy_from_slice(__input);
18827 Bytes::new(&payload_buf)
18828 } else {
18829 Bytes::new(__input)
18830 };
18831 let mut __struct = Self::default();
18832 __struct.target_system = buf.get_u8();
18833 __struct.target_component = buf.get_u8();
18834 let tmp = buf.get_u8();
18835 __struct.mavtype =
18836 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18837 enum_type: "MavMissionResult",
18838 value: tmp as u32,
18839 })?;
18840 let tmp = buf.get_u8();
18841 __struct.mission_type =
18842 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18843 enum_type: "MavMissionType",
18844 value: tmp as u32,
18845 })?;
18846 __struct.opaque_id = buf.get_u32_le();
18847 Ok(__struct)
18848 }
18849 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18850 let mut __tmp = BytesMut::new(bytes);
18851 #[allow(clippy::absurd_extreme_comparisons)]
18852 #[allow(unused_comparisons)]
18853 if __tmp.remaining() < Self::ENCODED_LEN {
18854 panic!(
18855 "buffer is too small (need {} bytes, but got {})",
18856 Self::ENCODED_LEN,
18857 __tmp.remaining(),
18858 )
18859 }
18860 __tmp.put_u8(self.target_system);
18861 __tmp.put_u8(self.target_component);
18862 __tmp.put_u8(self.mavtype as u8);
18863 __tmp.put_u8(self.mission_type as u8);
18864 __tmp.put_u32_le(self.opaque_id);
18865 if matches!(version, MavlinkVersion::V2) {
18866 let len = __tmp.len();
18867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18868 } else {
18869 __tmp.len()
18870 }
18871 }
18872}
18873#[doc = "id: 45"]
18874#[doc = "Delete all mission items at once."]
18875#[derive(Debug, Clone, PartialEq)]
18876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18878pub struct MISSION_CLEAR_ALL_DATA {
18879 #[doc = "System ID"]
18880 pub target_system: u8,
18881 #[doc = "Component ID"]
18882 pub target_component: u8,
18883 #[doc = "Mission type."]
18884 #[cfg_attr(feature = "serde", serde(default))]
18885 pub mission_type: MavMissionType,
18886}
18887impl MISSION_CLEAR_ALL_DATA {
18888 pub const ENCODED_LEN: usize = 3usize;
18889 pub const DEFAULT: Self = Self {
18890 target_system: 0_u8,
18891 target_component: 0_u8,
18892 mission_type: MavMissionType::DEFAULT,
18893 };
18894 #[cfg(feature = "arbitrary")]
18895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18896 use arbitrary::{Arbitrary, Unstructured};
18897 let mut buf = [0u8; 1024];
18898 rng.fill_bytes(&mut buf);
18899 let mut unstructured = Unstructured::new(&buf);
18900 Self::arbitrary(&mut unstructured).unwrap_or_default()
18901 }
18902}
18903impl Default for MISSION_CLEAR_ALL_DATA {
18904 fn default() -> Self {
18905 Self::DEFAULT.clone()
18906 }
18907}
18908impl MessageData for MISSION_CLEAR_ALL_DATA {
18909 type Message = MavMessage;
18910 const ID: u32 = 45u32;
18911 const NAME: &'static str = "MISSION_CLEAR_ALL";
18912 const EXTRA_CRC: u8 = 232u8;
18913 const ENCODED_LEN: usize = 3usize;
18914 fn deser(
18915 _version: MavlinkVersion,
18916 __input: &[u8],
18917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18918 let avail_len = __input.len();
18919 let mut payload_buf = [0; Self::ENCODED_LEN];
18920 let mut buf = if avail_len < Self::ENCODED_LEN {
18921 payload_buf[0..avail_len].copy_from_slice(__input);
18922 Bytes::new(&payload_buf)
18923 } else {
18924 Bytes::new(__input)
18925 };
18926 let mut __struct = Self::default();
18927 __struct.target_system = buf.get_u8();
18928 __struct.target_component = buf.get_u8();
18929 let tmp = buf.get_u8();
18930 __struct.mission_type =
18931 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18932 enum_type: "MavMissionType",
18933 value: tmp as u32,
18934 })?;
18935 Ok(__struct)
18936 }
18937 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18938 let mut __tmp = BytesMut::new(bytes);
18939 #[allow(clippy::absurd_extreme_comparisons)]
18940 #[allow(unused_comparisons)]
18941 if __tmp.remaining() < Self::ENCODED_LEN {
18942 panic!(
18943 "buffer is too small (need {} bytes, but got {})",
18944 Self::ENCODED_LEN,
18945 __tmp.remaining(),
18946 )
18947 }
18948 __tmp.put_u8(self.target_system);
18949 __tmp.put_u8(self.target_component);
18950 __tmp.put_u8(self.mission_type as u8);
18951 if matches!(version, MavlinkVersion::V2) {
18952 let len = __tmp.len();
18953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18954 } else {
18955 __tmp.len()
18956 }
18957 }
18958}
18959#[doc = "id: 44"]
18960#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
18961#[derive(Debug, Clone, PartialEq)]
18962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18964pub struct MISSION_COUNT_DATA {
18965 #[doc = "Number of mission items in the sequence"]
18966 pub count: u16,
18967 #[doc = "System ID"]
18968 pub target_system: u8,
18969 #[doc = "Component ID"]
18970 pub target_component: u8,
18971 #[doc = "Mission type."]
18972 #[cfg_attr(feature = "serde", serde(default))]
18973 pub mission_type: MavMissionType,
18974 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
18975 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18976 pub opaque_id: u32,
18977}
18978impl MISSION_COUNT_DATA {
18979 pub const ENCODED_LEN: usize = 9usize;
18980 pub const DEFAULT: Self = Self {
18981 count: 0_u16,
18982 target_system: 0_u8,
18983 target_component: 0_u8,
18984 mission_type: MavMissionType::DEFAULT,
18985 opaque_id: 0_u32,
18986 };
18987 #[cfg(feature = "arbitrary")]
18988 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18989 use arbitrary::{Arbitrary, Unstructured};
18990 let mut buf = [0u8; 1024];
18991 rng.fill_bytes(&mut buf);
18992 let mut unstructured = Unstructured::new(&buf);
18993 Self::arbitrary(&mut unstructured).unwrap_or_default()
18994 }
18995}
18996impl Default for MISSION_COUNT_DATA {
18997 fn default() -> Self {
18998 Self::DEFAULT.clone()
18999 }
19000}
19001impl MessageData for MISSION_COUNT_DATA {
19002 type Message = MavMessage;
19003 const ID: u32 = 44u32;
19004 const NAME: &'static str = "MISSION_COUNT";
19005 const EXTRA_CRC: u8 = 221u8;
19006 const ENCODED_LEN: usize = 9usize;
19007 fn deser(
19008 _version: MavlinkVersion,
19009 __input: &[u8],
19010 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19011 let avail_len = __input.len();
19012 let mut payload_buf = [0; Self::ENCODED_LEN];
19013 let mut buf = if avail_len < Self::ENCODED_LEN {
19014 payload_buf[0..avail_len].copy_from_slice(__input);
19015 Bytes::new(&payload_buf)
19016 } else {
19017 Bytes::new(__input)
19018 };
19019 let mut __struct = Self::default();
19020 __struct.count = buf.get_u16_le();
19021 __struct.target_system = buf.get_u8();
19022 __struct.target_component = buf.get_u8();
19023 let tmp = buf.get_u8();
19024 __struct.mission_type =
19025 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19026 enum_type: "MavMissionType",
19027 value: tmp as u32,
19028 })?;
19029 __struct.opaque_id = buf.get_u32_le();
19030 Ok(__struct)
19031 }
19032 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19033 let mut __tmp = BytesMut::new(bytes);
19034 #[allow(clippy::absurd_extreme_comparisons)]
19035 #[allow(unused_comparisons)]
19036 if __tmp.remaining() < Self::ENCODED_LEN {
19037 panic!(
19038 "buffer is too small (need {} bytes, but got {})",
19039 Self::ENCODED_LEN,
19040 __tmp.remaining(),
19041 )
19042 }
19043 __tmp.put_u16_le(self.count);
19044 __tmp.put_u8(self.target_system);
19045 __tmp.put_u8(self.target_component);
19046 __tmp.put_u8(self.mission_type as u8);
19047 __tmp.put_u32_le(self.opaque_id);
19048 if matches!(version, MavlinkVersion::V2) {
19049 let len = __tmp.len();
19050 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19051 } else {
19052 __tmp.len()
19053 }
19054 }
19055}
19056#[doc = "id: 42"]
19057#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19058#[derive(Debug, Clone, PartialEq)]
19059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19061pub struct MISSION_CURRENT_DATA {
19062 #[doc = "Sequence"]
19063 pub seq: u16,
19064 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19065 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19066 pub total: u16,
19067 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19068 #[cfg_attr(feature = "serde", serde(default))]
19069 pub mission_state: MissionState,
19070 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19071 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19072 pub mission_mode: u8,
19073 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19074 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19075 pub mission_id: u32,
19076 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19077 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19078 pub fence_id: u32,
19079 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19080 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19081 pub rally_points_id: u32,
19082}
19083impl MISSION_CURRENT_DATA {
19084 pub const ENCODED_LEN: usize = 18usize;
19085 pub const DEFAULT: Self = Self {
19086 seq: 0_u16,
19087 total: 0_u16,
19088 mission_state: MissionState::DEFAULT,
19089 mission_mode: 0_u8,
19090 mission_id: 0_u32,
19091 fence_id: 0_u32,
19092 rally_points_id: 0_u32,
19093 };
19094 #[cfg(feature = "arbitrary")]
19095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19096 use arbitrary::{Arbitrary, Unstructured};
19097 let mut buf = [0u8; 1024];
19098 rng.fill_bytes(&mut buf);
19099 let mut unstructured = Unstructured::new(&buf);
19100 Self::arbitrary(&mut unstructured).unwrap_or_default()
19101 }
19102}
19103impl Default for MISSION_CURRENT_DATA {
19104 fn default() -> Self {
19105 Self::DEFAULT.clone()
19106 }
19107}
19108impl MessageData for MISSION_CURRENT_DATA {
19109 type Message = MavMessage;
19110 const ID: u32 = 42u32;
19111 const NAME: &'static str = "MISSION_CURRENT";
19112 const EXTRA_CRC: u8 = 28u8;
19113 const ENCODED_LEN: usize = 18usize;
19114 fn deser(
19115 _version: MavlinkVersion,
19116 __input: &[u8],
19117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19118 let avail_len = __input.len();
19119 let mut payload_buf = [0; Self::ENCODED_LEN];
19120 let mut buf = if avail_len < Self::ENCODED_LEN {
19121 payload_buf[0..avail_len].copy_from_slice(__input);
19122 Bytes::new(&payload_buf)
19123 } else {
19124 Bytes::new(__input)
19125 };
19126 let mut __struct = Self::default();
19127 __struct.seq = buf.get_u16_le();
19128 __struct.total = buf.get_u16_le();
19129 let tmp = buf.get_u8();
19130 __struct.mission_state =
19131 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19132 enum_type: "MissionState",
19133 value: tmp as u32,
19134 })?;
19135 __struct.mission_mode = buf.get_u8();
19136 __struct.mission_id = buf.get_u32_le();
19137 __struct.fence_id = buf.get_u32_le();
19138 __struct.rally_points_id = buf.get_u32_le();
19139 Ok(__struct)
19140 }
19141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19142 let mut __tmp = BytesMut::new(bytes);
19143 #[allow(clippy::absurd_extreme_comparisons)]
19144 #[allow(unused_comparisons)]
19145 if __tmp.remaining() < Self::ENCODED_LEN {
19146 panic!(
19147 "buffer is too small (need {} bytes, but got {})",
19148 Self::ENCODED_LEN,
19149 __tmp.remaining(),
19150 )
19151 }
19152 __tmp.put_u16_le(self.seq);
19153 __tmp.put_u16_le(self.total);
19154 __tmp.put_u8(self.mission_state as u8);
19155 __tmp.put_u8(self.mission_mode);
19156 __tmp.put_u32_le(self.mission_id);
19157 __tmp.put_u32_le(self.fence_id);
19158 __tmp.put_u32_le(self.rally_points_id);
19159 if matches!(version, MavlinkVersion::V2) {
19160 let len = __tmp.len();
19161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19162 } else {
19163 __tmp.len()
19164 }
19165 }
19166}
19167#[doc = "id: 39"]
19168#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19169#[derive(Debug, Clone, PartialEq)]
19170#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19171#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19172pub struct MISSION_ITEM_DATA {
19173 #[doc = "PARAM1, see MAV_CMD enum"]
19174 pub param1: f32,
19175 #[doc = "PARAM2, see MAV_CMD enum"]
19176 pub param2: f32,
19177 #[doc = "PARAM3, see MAV_CMD enum"]
19178 pub param3: f32,
19179 #[doc = "PARAM4, see MAV_CMD enum"]
19180 pub param4: f32,
19181 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19182 pub x: f32,
19183 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19184 pub y: f32,
19185 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19186 pub z: f32,
19187 #[doc = "Sequence"]
19188 pub seq: u16,
19189 #[doc = "The scheduled action for the waypoint."]
19190 pub command: MavCmd,
19191 #[doc = "System ID"]
19192 pub target_system: u8,
19193 #[doc = "Component ID"]
19194 pub target_component: u8,
19195 #[doc = "The coordinate system of the waypoint."]
19196 pub frame: MavFrame,
19197 #[doc = "false:0, true:1"]
19198 pub current: u8,
19199 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19200 pub autocontinue: u8,
19201 #[doc = "Mission type."]
19202 #[cfg_attr(feature = "serde", serde(default))]
19203 pub mission_type: MavMissionType,
19204}
19205impl MISSION_ITEM_DATA {
19206 pub const ENCODED_LEN: usize = 38usize;
19207 pub const DEFAULT: Self = Self {
19208 param1: 0.0_f32,
19209 param2: 0.0_f32,
19210 param3: 0.0_f32,
19211 param4: 0.0_f32,
19212 x: 0.0_f32,
19213 y: 0.0_f32,
19214 z: 0.0_f32,
19215 seq: 0_u16,
19216 command: MavCmd::DEFAULT,
19217 target_system: 0_u8,
19218 target_component: 0_u8,
19219 frame: MavFrame::DEFAULT,
19220 current: 0_u8,
19221 autocontinue: 0_u8,
19222 mission_type: MavMissionType::DEFAULT,
19223 };
19224 #[cfg(feature = "arbitrary")]
19225 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19226 use arbitrary::{Arbitrary, Unstructured};
19227 let mut buf = [0u8; 1024];
19228 rng.fill_bytes(&mut buf);
19229 let mut unstructured = Unstructured::new(&buf);
19230 Self::arbitrary(&mut unstructured).unwrap_or_default()
19231 }
19232}
19233impl Default for MISSION_ITEM_DATA {
19234 fn default() -> Self {
19235 Self::DEFAULT.clone()
19236 }
19237}
19238impl MessageData for MISSION_ITEM_DATA {
19239 type Message = MavMessage;
19240 const ID: u32 = 39u32;
19241 const NAME: &'static str = "MISSION_ITEM";
19242 const EXTRA_CRC: u8 = 254u8;
19243 const ENCODED_LEN: usize = 38usize;
19244 fn deser(
19245 _version: MavlinkVersion,
19246 __input: &[u8],
19247 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19248 let avail_len = __input.len();
19249 let mut payload_buf = [0; Self::ENCODED_LEN];
19250 let mut buf = if avail_len < Self::ENCODED_LEN {
19251 payload_buf[0..avail_len].copy_from_slice(__input);
19252 Bytes::new(&payload_buf)
19253 } else {
19254 Bytes::new(__input)
19255 };
19256 let mut __struct = Self::default();
19257 __struct.param1 = buf.get_f32_le();
19258 __struct.param2 = buf.get_f32_le();
19259 __struct.param3 = buf.get_f32_le();
19260 __struct.param4 = buf.get_f32_le();
19261 __struct.x = buf.get_f32_le();
19262 __struct.y = buf.get_f32_le();
19263 __struct.z = buf.get_f32_le();
19264 __struct.seq = buf.get_u16_le();
19265 let tmp = buf.get_u16_le();
19266 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19267 ::mavlink_core::error::ParserError::InvalidEnum {
19268 enum_type: "MavCmd",
19269 value: tmp as u32,
19270 },
19271 )?;
19272 __struct.target_system = buf.get_u8();
19273 __struct.target_component = buf.get_u8();
19274 let tmp = buf.get_u8();
19275 __struct.frame =
19276 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19277 enum_type: "MavFrame",
19278 value: tmp as u32,
19279 })?;
19280 __struct.current = buf.get_u8();
19281 __struct.autocontinue = buf.get_u8();
19282 let tmp = buf.get_u8();
19283 __struct.mission_type =
19284 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19285 enum_type: "MavMissionType",
19286 value: tmp as u32,
19287 })?;
19288 Ok(__struct)
19289 }
19290 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19291 let mut __tmp = BytesMut::new(bytes);
19292 #[allow(clippy::absurd_extreme_comparisons)]
19293 #[allow(unused_comparisons)]
19294 if __tmp.remaining() < Self::ENCODED_LEN {
19295 panic!(
19296 "buffer is too small (need {} bytes, but got {})",
19297 Self::ENCODED_LEN,
19298 __tmp.remaining(),
19299 )
19300 }
19301 __tmp.put_f32_le(self.param1);
19302 __tmp.put_f32_le(self.param2);
19303 __tmp.put_f32_le(self.param3);
19304 __tmp.put_f32_le(self.param4);
19305 __tmp.put_f32_le(self.x);
19306 __tmp.put_f32_le(self.y);
19307 __tmp.put_f32_le(self.z);
19308 __tmp.put_u16_le(self.seq);
19309 __tmp.put_u16_le(self.command as u16);
19310 __tmp.put_u8(self.target_system);
19311 __tmp.put_u8(self.target_component);
19312 __tmp.put_u8(self.frame as u8);
19313 __tmp.put_u8(self.current);
19314 __tmp.put_u8(self.autocontinue);
19315 __tmp.put_u8(self.mission_type as u8);
19316 if matches!(version, MavlinkVersion::V2) {
19317 let len = __tmp.len();
19318 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19319 } else {
19320 __tmp.len()
19321 }
19322 }
19323}
19324#[doc = "id: 73"]
19325#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19326#[derive(Debug, Clone, PartialEq)]
19327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19329pub struct MISSION_ITEM_INT_DATA {
19330 #[doc = "PARAM1, see MAV_CMD enum"]
19331 pub param1: f32,
19332 #[doc = "PARAM2, see MAV_CMD enum"]
19333 pub param2: f32,
19334 #[doc = "PARAM3, see MAV_CMD enum"]
19335 pub param3: f32,
19336 #[doc = "PARAM4, see MAV_CMD enum"]
19337 pub param4: f32,
19338 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19339 pub x: i32,
19340 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19341 pub y: i32,
19342 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19343 pub z: f32,
19344 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19345 pub seq: u16,
19346 #[doc = "The scheduled action for the waypoint."]
19347 pub command: MavCmd,
19348 #[doc = "System ID"]
19349 pub target_system: u8,
19350 #[doc = "Component ID"]
19351 pub target_component: u8,
19352 #[doc = "The coordinate system of the waypoint."]
19353 pub frame: MavFrame,
19354 #[doc = "false:0, true:1"]
19355 pub current: u8,
19356 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19357 pub autocontinue: u8,
19358 #[doc = "Mission type."]
19359 #[cfg_attr(feature = "serde", serde(default))]
19360 pub mission_type: MavMissionType,
19361}
19362impl MISSION_ITEM_INT_DATA {
19363 pub const ENCODED_LEN: usize = 38usize;
19364 pub const DEFAULT: Self = Self {
19365 param1: 0.0_f32,
19366 param2: 0.0_f32,
19367 param3: 0.0_f32,
19368 param4: 0.0_f32,
19369 x: 0_i32,
19370 y: 0_i32,
19371 z: 0.0_f32,
19372 seq: 0_u16,
19373 command: MavCmd::DEFAULT,
19374 target_system: 0_u8,
19375 target_component: 0_u8,
19376 frame: MavFrame::DEFAULT,
19377 current: 0_u8,
19378 autocontinue: 0_u8,
19379 mission_type: MavMissionType::DEFAULT,
19380 };
19381 #[cfg(feature = "arbitrary")]
19382 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19383 use arbitrary::{Arbitrary, Unstructured};
19384 let mut buf = [0u8; 1024];
19385 rng.fill_bytes(&mut buf);
19386 let mut unstructured = Unstructured::new(&buf);
19387 Self::arbitrary(&mut unstructured).unwrap_or_default()
19388 }
19389}
19390impl Default for MISSION_ITEM_INT_DATA {
19391 fn default() -> Self {
19392 Self::DEFAULT.clone()
19393 }
19394}
19395impl MessageData for MISSION_ITEM_INT_DATA {
19396 type Message = MavMessage;
19397 const ID: u32 = 73u32;
19398 const NAME: &'static str = "MISSION_ITEM_INT";
19399 const EXTRA_CRC: u8 = 38u8;
19400 const ENCODED_LEN: usize = 38usize;
19401 fn deser(
19402 _version: MavlinkVersion,
19403 __input: &[u8],
19404 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19405 let avail_len = __input.len();
19406 let mut payload_buf = [0; Self::ENCODED_LEN];
19407 let mut buf = if avail_len < Self::ENCODED_LEN {
19408 payload_buf[0..avail_len].copy_from_slice(__input);
19409 Bytes::new(&payload_buf)
19410 } else {
19411 Bytes::new(__input)
19412 };
19413 let mut __struct = Self::default();
19414 __struct.param1 = buf.get_f32_le();
19415 __struct.param2 = buf.get_f32_le();
19416 __struct.param3 = buf.get_f32_le();
19417 __struct.param4 = buf.get_f32_le();
19418 __struct.x = buf.get_i32_le();
19419 __struct.y = buf.get_i32_le();
19420 __struct.z = buf.get_f32_le();
19421 __struct.seq = buf.get_u16_le();
19422 let tmp = buf.get_u16_le();
19423 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19424 ::mavlink_core::error::ParserError::InvalidEnum {
19425 enum_type: "MavCmd",
19426 value: tmp as u32,
19427 },
19428 )?;
19429 __struct.target_system = buf.get_u8();
19430 __struct.target_component = buf.get_u8();
19431 let tmp = buf.get_u8();
19432 __struct.frame =
19433 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19434 enum_type: "MavFrame",
19435 value: tmp as u32,
19436 })?;
19437 __struct.current = buf.get_u8();
19438 __struct.autocontinue = buf.get_u8();
19439 let tmp = buf.get_u8();
19440 __struct.mission_type =
19441 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19442 enum_type: "MavMissionType",
19443 value: tmp as u32,
19444 })?;
19445 Ok(__struct)
19446 }
19447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19448 let mut __tmp = BytesMut::new(bytes);
19449 #[allow(clippy::absurd_extreme_comparisons)]
19450 #[allow(unused_comparisons)]
19451 if __tmp.remaining() < Self::ENCODED_LEN {
19452 panic!(
19453 "buffer is too small (need {} bytes, but got {})",
19454 Self::ENCODED_LEN,
19455 __tmp.remaining(),
19456 )
19457 }
19458 __tmp.put_f32_le(self.param1);
19459 __tmp.put_f32_le(self.param2);
19460 __tmp.put_f32_le(self.param3);
19461 __tmp.put_f32_le(self.param4);
19462 __tmp.put_i32_le(self.x);
19463 __tmp.put_i32_le(self.y);
19464 __tmp.put_f32_le(self.z);
19465 __tmp.put_u16_le(self.seq);
19466 __tmp.put_u16_le(self.command as u16);
19467 __tmp.put_u8(self.target_system);
19468 __tmp.put_u8(self.target_component);
19469 __tmp.put_u8(self.frame as u8);
19470 __tmp.put_u8(self.current);
19471 __tmp.put_u8(self.autocontinue);
19472 __tmp.put_u8(self.mission_type as u8);
19473 if matches!(version, MavlinkVersion::V2) {
19474 let len = __tmp.len();
19475 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19476 } else {
19477 __tmp.len()
19478 }
19479 }
19480}
19481#[doc = "id: 46"]
19482#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19483#[derive(Debug, Clone, PartialEq)]
19484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19486pub struct MISSION_ITEM_REACHED_DATA {
19487 #[doc = "Sequence"]
19488 pub seq: u16,
19489}
19490impl MISSION_ITEM_REACHED_DATA {
19491 pub const ENCODED_LEN: usize = 2usize;
19492 pub const DEFAULT: Self = Self { seq: 0_u16 };
19493 #[cfg(feature = "arbitrary")]
19494 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19495 use arbitrary::{Arbitrary, Unstructured};
19496 let mut buf = [0u8; 1024];
19497 rng.fill_bytes(&mut buf);
19498 let mut unstructured = Unstructured::new(&buf);
19499 Self::arbitrary(&mut unstructured).unwrap_or_default()
19500 }
19501}
19502impl Default for MISSION_ITEM_REACHED_DATA {
19503 fn default() -> Self {
19504 Self::DEFAULT.clone()
19505 }
19506}
19507impl MessageData for MISSION_ITEM_REACHED_DATA {
19508 type Message = MavMessage;
19509 const ID: u32 = 46u32;
19510 const NAME: &'static str = "MISSION_ITEM_REACHED";
19511 const EXTRA_CRC: u8 = 11u8;
19512 const ENCODED_LEN: usize = 2usize;
19513 fn deser(
19514 _version: MavlinkVersion,
19515 __input: &[u8],
19516 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19517 let avail_len = __input.len();
19518 let mut payload_buf = [0; Self::ENCODED_LEN];
19519 let mut buf = if avail_len < Self::ENCODED_LEN {
19520 payload_buf[0..avail_len].copy_from_slice(__input);
19521 Bytes::new(&payload_buf)
19522 } else {
19523 Bytes::new(__input)
19524 };
19525 let mut __struct = Self::default();
19526 __struct.seq = buf.get_u16_le();
19527 Ok(__struct)
19528 }
19529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19530 let mut __tmp = BytesMut::new(bytes);
19531 #[allow(clippy::absurd_extreme_comparisons)]
19532 #[allow(unused_comparisons)]
19533 if __tmp.remaining() < Self::ENCODED_LEN {
19534 panic!(
19535 "buffer is too small (need {} bytes, but got {})",
19536 Self::ENCODED_LEN,
19537 __tmp.remaining(),
19538 )
19539 }
19540 __tmp.put_u16_le(self.seq);
19541 if matches!(version, MavlinkVersion::V2) {
19542 let len = __tmp.len();
19543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19544 } else {
19545 __tmp.len()
19546 }
19547 }
19548}
19549#[doc = "id: 40"]
19550#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19551#[derive(Debug, Clone, PartialEq)]
19552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19554pub struct MISSION_REQUEST_DATA {
19555 #[doc = "Sequence"]
19556 pub seq: u16,
19557 #[doc = "System ID"]
19558 pub target_system: u8,
19559 #[doc = "Component ID"]
19560 pub target_component: u8,
19561 #[doc = "Mission type."]
19562 #[cfg_attr(feature = "serde", serde(default))]
19563 pub mission_type: MavMissionType,
19564}
19565impl MISSION_REQUEST_DATA {
19566 pub const ENCODED_LEN: usize = 5usize;
19567 pub const DEFAULT: Self = Self {
19568 seq: 0_u16,
19569 target_system: 0_u8,
19570 target_component: 0_u8,
19571 mission_type: MavMissionType::DEFAULT,
19572 };
19573 #[cfg(feature = "arbitrary")]
19574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19575 use arbitrary::{Arbitrary, Unstructured};
19576 let mut buf = [0u8; 1024];
19577 rng.fill_bytes(&mut buf);
19578 let mut unstructured = Unstructured::new(&buf);
19579 Self::arbitrary(&mut unstructured).unwrap_or_default()
19580 }
19581}
19582impl Default for MISSION_REQUEST_DATA {
19583 fn default() -> Self {
19584 Self::DEFAULT.clone()
19585 }
19586}
19587impl MessageData for MISSION_REQUEST_DATA {
19588 type Message = MavMessage;
19589 const ID: u32 = 40u32;
19590 const NAME: &'static str = "MISSION_REQUEST";
19591 const EXTRA_CRC: u8 = 230u8;
19592 const ENCODED_LEN: usize = 5usize;
19593 fn deser(
19594 _version: MavlinkVersion,
19595 __input: &[u8],
19596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19597 let avail_len = __input.len();
19598 let mut payload_buf = [0; Self::ENCODED_LEN];
19599 let mut buf = if avail_len < Self::ENCODED_LEN {
19600 payload_buf[0..avail_len].copy_from_slice(__input);
19601 Bytes::new(&payload_buf)
19602 } else {
19603 Bytes::new(__input)
19604 };
19605 let mut __struct = Self::default();
19606 __struct.seq = buf.get_u16_le();
19607 __struct.target_system = buf.get_u8();
19608 __struct.target_component = buf.get_u8();
19609 let tmp = buf.get_u8();
19610 __struct.mission_type =
19611 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19612 enum_type: "MavMissionType",
19613 value: tmp as u32,
19614 })?;
19615 Ok(__struct)
19616 }
19617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19618 let mut __tmp = BytesMut::new(bytes);
19619 #[allow(clippy::absurd_extreme_comparisons)]
19620 #[allow(unused_comparisons)]
19621 if __tmp.remaining() < Self::ENCODED_LEN {
19622 panic!(
19623 "buffer is too small (need {} bytes, but got {})",
19624 Self::ENCODED_LEN,
19625 __tmp.remaining(),
19626 )
19627 }
19628 __tmp.put_u16_le(self.seq);
19629 __tmp.put_u8(self.target_system);
19630 __tmp.put_u8(self.target_component);
19631 __tmp.put_u8(self.mission_type as u8);
19632 if matches!(version, MavlinkVersion::V2) {
19633 let len = __tmp.len();
19634 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19635 } else {
19636 __tmp.len()
19637 }
19638 }
19639}
19640#[doc = "id: 51"]
19641#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19642#[derive(Debug, Clone, PartialEq)]
19643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19645pub struct MISSION_REQUEST_INT_DATA {
19646 #[doc = "Sequence"]
19647 pub seq: u16,
19648 #[doc = "System ID"]
19649 pub target_system: u8,
19650 #[doc = "Component ID"]
19651 pub target_component: u8,
19652 #[doc = "Mission type."]
19653 #[cfg_attr(feature = "serde", serde(default))]
19654 pub mission_type: MavMissionType,
19655}
19656impl MISSION_REQUEST_INT_DATA {
19657 pub const ENCODED_LEN: usize = 5usize;
19658 pub const DEFAULT: Self = Self {
19659 seq: 0_u16,
19660 target_system: 0_u8,
19661 target_component: 0_u8,
19662 mission_type: MavMissionType::DEFAULT,
19663 };
19664 #[cfg(feature = "arbitrary")]
19665 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19666 use arbitrary::{Arbitrary, Unstructured};
19667 let mut buf = [0u8; 1024];
19668 rng.fill_bytes(&mut buf);
19669 let mut unstructured = Unstructured::new(&buf);
19670 Self::arbitrary(&mut unstructured).unwrap_or_default()
19671 }
19672}
19673impl Default for MISSION_REQUEST_INT_DATA {
19674 fn default() -> Self {
19675 Self::DEFAULT.clone()
19676 }
19677}
19678impl MessageData for MISSION_REQUEST_INT_DATA {
19679 type Message = MavMessage;
19680 const ID: u32 = 51u32;
19681 const NAME: &'static str = "MISSION_REQUEST_INT";
19682 const EXTRA_CRC: u8 = 196u8;
19683 const ENCODED_LEN: usize = 5usize;
19684 fn deser(
19685 _version: MavlinkVersion,
19686 __input: &[u8],
19687 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19688 let avail_len = __input.len();
19689 let mut payload_buf = [0; Self::ENCODED_LEN];
19690 let mut buf = if avail_len < Self::ENCODED_LEN {
19691 payload_buf[0..avail_len].copy_from_slice(__input);
19692 Bytes::new(&payload_buf)
19693 } else {
19694 Bytes::new(__input)
19695 };
19696 let mut __struct = Self::default();
19697 __struct.seq = buf.get_u16_le();
19698 __struct.target_system = buf.get_u8();
19699 __struct.target_component = buf.get_u8();
19700 let tmp = buf.get_u8();
19701 __struct.mission_type =
19702 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19703 enum_type: "MavMissionType",
19704 value: tmp as u32,
19705 })?;
19706 Ok(__struct)
19707 }
19708 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19709 let mut __tmp = BytesMut::new(bytes);
19710 #[allow(clippy::absurd_extreme_comparisons)]
19711 #[allow(unused_comparisons)]
19712 if __tmp.remaining() < Self::ENCODED_LEN {
19713 panic!(
19714 "buffer is too small (need {} bytes, but got {})",
19715 Self::ENCODED_LEN,
19716 __tmp.remaining(),
19717 )
19718 }
19719 __tmp.put_u16_le(self.seq);
19720 __tmp.put_u8(self.target_system);
19721 __tmp.put_u8(self.target_component);
19722 __tmp.put_u8(self.mission_type as u8);
19723 if matches!(version, MavlinkVersion::V2) {
19724 let len = __tmp.len();
19725 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19726 } else {
19727 __tmp.len()
19728 }
19729 }
19730}
19731#[doc = "id: 43"]
19732#[doc = "Request the overall list of mission items from the system/component."]
19733#[derive(Debug, Clone, PartialEq)]
19734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19736pub struct MISSION_REQUEST_LIST_DATA {
19737 #[doc = "System ID"]
19738 pub target_system: u8,
19739 #[doc = "Component ID"]
19740 pub target_component: u8,
19741 #[doc = "Mission type."]
19742 #[cfg_attr(feature = "serde", serde(default))]
19743 pub mission_type: MavMissionType,
19744}
19745impl MISSION_REQUEST_LIST_DATA {
19746 pub const ENCODED_LEN: usize = 3usize;
19747 pub const DEFAULT: Self = Self {
19748 target_system: 0_u8,
19749 target_component: 0_u8,
19750 mission_type: MavMissionType::DEFAULT,
19751 };
19752 #[cfg(feature = "arbitrary")]
19753 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19754 use arbitrary::{Arbitrary, Unstructured};
19755 let mut buf = [0u8; 1024];
19756 rng.fill_bytes(&mut buf);
19757 let mut unstructured = Unstructured::new(&buf);
19758 Self::arbitrary(&mut unstructured).unwrap_or_default()
19759 }
19760}
19761impl Default for MISSION_REQUEST_LIST_DATA {
19762 fn default() -> Self {
19763 Self::DEFAULT.clone()
19764 }
19765}
19766impl MessageData for MISSION_REQUEST_LIST_DATA {
19767 type Message = MavMessage;
19768 const ID: u32 = 43u32;
19769 const NAME: &'static str = "MISSION_REQUEST_LIST";
19770 const EXTRA_CRC: u8 = 132u8;
19771 const ENCODED_LEN: usize = 3usize;
19772 fn deser(
19773 _version: MavlinkVersion,
19774 __input: &[u8],
19775 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19776 let avail_len = __input.len();
19777 let mut payload_buf = [0; Self::ENCODED_LEN];
19778 let mut buf = if avail_len < Self::ENCODED_LEN {
19779 payload_buf[0..avail_len].copy_from_slice(__input);
19780 Bytes::new(&payload_buf)
19781 } else {
19782 Bytes::new(__input)
19783 };
19784 let mut __struct = Self::default();
19785 __struct.target_system = buf.get_u8();
19786 __struct.target_component = buf.get_u8();
19787 let tmp = buf.get_u8();
19788 __struct.mission_type =
19789 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19790 enum_type: "MavMissionType",
19791 value: tmp as u32,
19792 })?;
19793 Ok(__struct)
19794 }
19795 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19796 let mut __tmp = BytesMut::new(bytes);
19797 #[allow(clippy::absurd_extreme_comparisons)]
19798 #[allow(unused_comparisons)]
19799 if __tmp.remaining() < Self::ENCODED_LEN {
19800 panic!(
19801 "buffer is too small (need {} bytes, but got {})",
19802 Self::ENCODED_LEN,
19803 __tmp.remaining(),
19804 )
19805 }
19806 __tmp.put_u8(self.target_system);
19807 __tmp.put_u8(self.target_component);
19808 __tmp.put_u8(self.mission_type as u8);
19809 if matches!(version, MavlinkVersion::V2) {
19810 let len = __tmp.len();
19811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19812 } else {
19813 __tmp.len()
19814 }
19815 }
19816}
19817#[doc = "id: 37"]
19818#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
19819#[derive(Debug, Clone, PartialEq)]
19820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19822pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
19823 #[doc = "Start index"]
19824 pub start_index: i16,
19825 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
19826 pub end_index: i16,
19827 #[doc = "System ID"]
19828 pub target_system: u8,
19829 #[doc = "Component ID"]
19830 pub target_component: u8,
19831 #[doc = "Mission type."]
19832 #[cfg_attr(feature = "serde", serde(default))]
19833 pub mission_type: MavMissionType,
19834}
19835impl MISSION_REQUEST_PARTIAL_LIST_DATA {
19836 pub const ENCODED_LEN: usize = 7usize;
19837 pub const DEFAULT: Self = Self {
19838 start_index: 0_i16,
19839 end_index: 0_i16,
19840 target_system: 0_u8,
19841 target_component: 0_u8,
19842 mission_type: MavMissionType::DEFAULT,
19843 };
19844 #[cfg(feature = "arbitrary")]
19845 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19846 use arbitrary::{Arbitrary, Unstructured};
19847 let mut buf = [0u8; 1024];
19848 rng.fill_bytes(&mut buf);
19849 let mut unstructured = Unstructured::new(&buf);
19850 Self::arbitrary(&mut unstructured).unwrap_or_default()
19851 }
19852}
19853impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
19854 fn default() -> Self {
19855 Self::DEFAULT.clone()
19856 }
19857}
19858impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
19859 type Message = MavMessage;
19860 const ID: u32 = 37u32;
19861 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
19862 const EXTRA_CRC: u8 = 212u8;
19863 const ENCODED_LEN: usize = 7usize;
19864 fn deser(
19865 _version: MavlinkVersion,
19866 __input: &[u8],
19867 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19868 let avail_len = __input.len();
19869 let mut payload_buf = [0; Self::ENCODED_LEN];
19870 let mut buf = if avail_len < Self::ENCODED_LEN {
19871 payload_buf[0..avail_len].copy_from_slice(__input);
19872 Bytes::new(&payload_buf)
19873 } else {
19874 Bytes::new(__input)
19875 };
19876 let mut __struct = Self::default();
19877 __struct.start_index = buf.get_i16_le();
19878 __struct.end_index = buf.get_i16_le();
19879 __struct.target_system = buf.get_u8();
19880 __struct.target_component = buf.get_u8();
19881 let tmp = buf.get_u8();
19882 __struct.mission_type =
19883 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19884 enum_type: "MavMissionType",
19885 value: tmp as u32,
19886 })?;
19887 Ok(__struct)
19888 }
19889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19890 let mut __tmp = BytesMut::new(bytes);
19891 #[allow(clippy::absurd_extreme_comparisons)]
19892 #[allow(unused_comparisons)]
19893 if __tmp.remaining() < Self::ENCODED_LEN {
19894 panic!(
19895 "buffer is too small (need {} bytes, but got {})",
19896 Self::ENCODED_LEN,
19897 __tmp.remaining(),
19898 )
19899 }
19900 __tmp.put_i16_le(self.start_index);
19901 __tmp.put_i16_le(self.end_index);
19902 __tmp.put_u8(self.target_system);
19903 __tmp.put_u8(self.target_component);
19904 __tmp.put_u8(self.mission_type as u8);
19905 if matches!(version, MavlinkVersion::V2) {
19906 let len = __tmp.len();
19907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19908 } else {
19909 __tmp.len()
19910 }
19911 }
19912}
19913#[doc = "id: 41"]
19914#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
19915#[derive(Debug, Clone, PartialEq)]
19916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19918pub struct MISSION_SET_CURRENT_DATA {
19919 #[doc = "Sequence"]
19920 pub seq: u16,
19921 #[doc = "System ID"]
19922 pub target_system: u8,
19923 #[doc = "Component ID"]
19924 pub target_component: u8,
19925}
19926impl MISSION_SET_CURRENT_DATA {
19927 pub const ENCODED_LEN: usize = 4usize;
19928 pub const DEFAULT: Self = Self {
19929 seq: 0_u16,
19930 target_system: 0_u8,
19931 target_component: 0_u8,
19932 };
19933 #[cfg(feature = "arbitrary")]
19934 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19935 use arbitrary::{Arbitrary, Unstructured};
19936 let mut buf = [0u8; 1024];
19937 rng.fill_bytes(&mut buf);
19938 let mut unstructured = Unstructured::new(&buf);
19939 Self::arbitrary(&mut unstructured).unwrap_or_default()
19940 }
19941}
19942impl Default for MISSION_SET_CURRENT_DATA {
19943 fn default() -> Self {
19944 Self::DEFAULT.clone()
19945 }
19946}
19947impl MessageData for MISSION_SET_CURRENT_DATA {
19948 type Message = MavMessage;
19949 const ID: u32 = 41u32;
19950 const NAME: &'static str = "MISSION_SET_CURRENT";
19951 const EXTRA_CRC: u8 = 28u8;
19952 const ENCODED_LEN: usize = 4usize;
19953 fn deser(
19954 _version: MavlinkVersion,
19955 __input: &[u8],
19956 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19957 let avail_len = __input.len();
19958 let mut payload_buf = [0; Self::ENCODED_LEN];
19959 let mut buf = if avail_len < Self::ENCODED_LEN {
19960 payload_buf[0..avail_len].copy_from_slice(__input);
19961 Bytes::new(&payload_buf)
19962 } else {
19963 Bytes::new(__input)
19964 };
19965 let mut __struct = Self::default();
19966 __struct.seq = buf.get_u16_le();
19967 __struct.target_system = buf.get_u8();
19968 __struct.target_component = buf.get_u8();
19969 Ok(__struct)
19970 }
19971 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19972 let mut __tmp = BytesMut::new(bytes);
19973 #[allow(clippy::absurd_extreme_comparisons)]
19974 #[allow(unused_comparisons)]
19975 if __tmp.remaining() < Self::ENCODED_LEN {
19976 panic!(
19977 "buffer is too small (need {} bytes, but got {})",
19978 Self::ENCODED_LEN,
19979 __tmp.remaining(),
19980 )
19981 }
19982 __tmp.put_u16_le(self.seq);
19983 __tmp.put_u8(self.target_system);
19984 __tmp.put_u8(self.target_component);
19985 if matches!(version, MavlinkVersion::V2) {
19986 let len = __tmp.len();
19987 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19988 } else {
19989 __tmp.len()
19990 }
19991 }
19992}
19993#[doc = "id: 38"]
19994#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
19995#[derive(Debug, Clone, PartialEq)]
19996#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19998pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
19999 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20000 pub start_index: i16,
20001 #[doc = "End index, equal or greater than start index."]
20002 pub end_index: i16,
20003 #[doc = "System ID"]
20004 pub target_system: u8,
20005 #[doc = "Component ID"]
20006 pub target_component: u8,
20007 #[doc = "Mission type."]
20008 #[cfg_attr(feature = "serde", serde(default))]
20009 pub mission_type: MavMissionType,
20010}
20011impl MISSION_WRITE_PARTIAL_LIST_DATA {
20012 pub const ENCODED_LEN: usize = 7usize;
20013 pub const DEFAULT: Self = Self {
20014 start_index: 0_i16,
20015 end_index: 0_i16,
20016 target_system: 0_u8,
20017 target_component: 0_u8,
20018 mission_type: MavMissionType::DEFAULT,
20019 };
20020 #[cfg(feature = "arbitrary")]
20021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20022 use arbitrary::{Arbitrary, Unstructured};
20023 let mut buf = [0u8; 1024];
20024 rng.fill_bytes(&mut buf);
20025 let mut unstructured = Unstructured::new(&buf);
20026 Self::arbitrary(&mut unstructured).unwrap_or_default()
20027 }
20028}
20029impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20030 fn default() -> Self {
20031 Self::DEFAULT.clone()
20032 }
20033}
20034impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20035 type Message = MavMessage;
20036 const ID: u32 = 38u32;
20037 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20038 const EXTRA_CRC: u8 = 9u8;
20039 const ENCODED_LEN: usize = 7usize;
20040 fn deser(
20041 _version: MavlinkVersion,
20042 __input: &[u8],
20043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20044 let avail_len = __input.len();
20045 let mut payload_buf = [0; Self::ENCODED_LEN];
20046 let mut buf = if avail_len < Self::ENCODED_LEN {
20047 payload_buf[0..avail_len].copy_from_slice(__input);
20048 Bytes::new(&payload_buf)
20049 } else {
20050 Bytes::new(__input)
20051 };
20052 let mut __struct = Self::default();
20053 __struct.start_index = buf.get_i16_le();
20054 __struct.end_index = buf.get_i16_le();
20055 __struct.target_system = buf.get_u8();
20056 __struct.target_component = buf.get_u8();
20057 let tmp = buf.get_u8();
20058 __struct.mission_type =
20059 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20060 enum_type: "MavMissionType",
20061 value: tmp as u32,
20062 })?;
20063 Ok(__struct)
20064 }
20065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20066 let mut __tmp = BytesMut::new(bytes);
20067 #[allow(clippy::absurd_extreme_comparisons)]
20068 #[allow(unused_comparisons)]
20069 if __tmp.remaining() < Self::ENCODED_LEN {
20070 panic!(
20071 "buffer is too small (need {} bytes, but got {})",
20072 Self::ENCODED_LEN,
20073 __tmp.remaining(),
20074 )
20075 }
20076 __tmp.put_i16_le(self.start_index);
20077 __tmp.put_i16_le(self.end_index);
20078 __tmp.put_u8(self.target_system);
20079 __tmp.put_u8(self.target_component);
20080 __tmp.put_u8(self.mission_type as u8);
20081 if matches!(version, MavlinkVersion::V2) {
20082 let len = __tmp.len();
20083 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20084 } else {
20085 __tmp.len()
20086 }
20087 }
20088}
20089#[doc = "id: 265"]
20090#[doc = "Orientation of a mount."]
20091#[derive(Debug, Clone, PartialEq)]
20092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20094pub struct MOUNT_ORIENTATION_DATA {
20095 #[doc = "Timestamp (time since system boot)."]
20096 pub time_boot_ms: u32,
20097 #[doc = "Roll in global frame (set to NaN for invalid)."]
20098 pub roll: f32,
20099 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20100 pub pitch: f32,
20101 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20102 pub yaw: f32,
20103 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20104 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20105 pub yaw_absolute: f32,
20106}
20107impl MOUNT_ORIENTATION_DATA {
20108 pub const ENCODED_LEN: usize = 20usize;
20109 pub const DEFAULT: Self = Self {
20110 time_boot_ms: 0_u32,
20111 roll: 0.0_f32,
20112 pitch: 0.0_f32,
20113 yaw: 0.0_f32,
20114 yaw_absolute: 0.0_f32,
20115 };
20116 #[cfg(feature = "arbitrary")]
20117 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20118 use arbitrary::{Arbitrary, Unstructured};
20119 let mut buf = [0u8; 1024];
20120 rng.fill_bytes(&mut buf);
20121 let mut unstructured = Unstructured::new(&buf);
20122 Self::arbitrary(&mut unstructured).unwrap_or_default()
20123 }
20124}
20125impl Default for MOUNT_ORIENTATION_DATA {
20126 fn default() -> Self {
20127 Self::DEFAULT.clone()
20128 }
20129}
20130impl MessageData for MOUNT_ORIENTATION_DATA {
20131 type Message = MavMessage;
20132 const ID: u32 = 265u32;
20133 const NAME: &'static str = "MOUNT_ORIENTATION";
20134 const EXTRA_CRC: u8 = 26u8;
20135 const ENCODED_LEN: usize = 20usize;
20136 fn deser(
20137 _version: MavlinkVersion,
20138 __input: &[u8],
20139 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20140 let avail_len = __input.len();
20141 let mut payload_buf = [0; Self::ENCODED_LEN];
20142 let mut buf = if avail_len < Self::ENCODED_LEN {
20143 payload_buf[0..avail_len].copy_from_slice(__input);
20144 Bytes::new(&payload_buf)
20145 } else {
20146 Bytes::new(__input)
20147 };
20148 let mut __struct = Self::default();
20149 __struct.time_boot_ms = buf.get_u32_le();
20150 __struct.roll = buf.get_f32_le();
20151 __struct.pitch = buf.get_f32_le();
20152 __struct.yaw = buf.get_f32_le();
20153 __struct.yaw_absolute = buf.get_f32_le();
20154 Ok(__struct)
20155 }
20156 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20157 let mut __tmp = BytesMut::new(bytes);
20158 #[allow(clippy::absurd_extreme_comparisons)]
20159 #[allow(unused_comparisons)]
20160 if __tmp.remaining() < Self::ENCODED_LEN {
20161 panic!(
20162 "buffer is too small (need {} bytes, but got {})",
20163 Self::ENCODED_LEN,
20164 __tmp.remaining(),
20165 )
20166 }
20167 __tmp.put_u32_le(self.time_boot_ms);
20168 __tmp.put_f32_le(self.roll);
20169 __tmp.put_f32_le(self.pitch);
20170 __tmp.put_f32_le(self.yaw);
20171 __tmp.put_f32_le(self.yaw_absolute);
20172 if matches!(version, MavlinkVersion::V2) {
20173 let len = __tmp.len();
20174 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20175 } else {
20176 __tmp.len()
20177 }
20178 }
20179}
20180#[doc = "id: 251"]
20181#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20182#[derive(Debug, Clone, PartialEq)]
20183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20185pub struct NAMED_VALUE_FLOAT_DATA {
20186 #[doc = "Timestamp (time since system boot)."]
20187 pub time_boot_ms: u32,
20188 #[doc = "Floating point value"]
20189 pub value: f32,
20190 #[doc = "Name of the debug variable"]
20191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20192 pub name: [u8; 10],
20193}
20194impl NAMED_VALUE_FLOAT_DATA {
20195 pub const ENCODED_LEN: usize = 18usize;
20196 pub const DEFAULT: Self = Self {
20197 time_boot_ms: 0_u32,
20198 value: 0.0_f32,
20199 name: [0_u8; 10usize],
20200 };
20201 #[cfg(feature = "arbitrary")]
20202 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20203 use arbitrary::{Arbitrary, Unstructured};
20204 let mut buf = [0u8; 1024];
20205 rng.fill_bytes(&mut buf);
20206 let mut unstructured = Unstructured::new(&buf);
20207 Self::arbitrary(&mut unstructured).unwrap_or_default()
20208 }
20209}
20210impl Default for NAMED_VALUE_FLOAT_DATA {
20211 fn default() -> Self {
20212 Self::DEFAULT.clone()
20213 }
20214}
20215impl MessageData for NAMED_VALUE_FLOAT_DATA {
20216 type Message = MavMessage;
20217 const ID: u32 = 251u32;
20218 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20219 const EXTRA_CRC: u8 = 170u8;
20220 const ENCODED_LEN: usize = 18usize;
20221 fn deser(
20222 _version: MavlinkVersion,
20223 __input: &[u8],
20224 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20225 let avail_len = __input.len();
20226 let mut payload_buf = [0; Self::ENCODED_LEN];
20227 let mut buf = if avail_len < Self::ENCODED_LEN {
20228 payload_buf[0..avail_len].copy_from_slice(__input);
20229 Bytes::new(&payload_buf)
20230 } else {
20231 Bytes::new(__input)
20232 };
20233 let mut __struct = Self::default();
20234 __struct.time_boot_ms = buf.get_u32_le();
20235 __struct.value = buf.get_f32_le();
20236 for v in &mut __struct.name {
20237 let val = buf.get_u8();
20238 *v = val;
20239 }
20240 Ok(__struct)
20241 }
20242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20243 let mut __tmp = BytesMut::new(bytes);
20244 #[allow(clippy::absurd_extreme_comparisons)]
20245 #[allow(unused_comparisons)]
20246 if __tmp.remaining() < Self::ENCODED_LEN {
20247 panic!(
20248 "buffer is too small (need {} bytes, but got {})",
20249 Self::ENCODED_LEN,
20250 __tmp.remaining(),
20251 )
20252 }
20253 __tmp.put_u32_le(self.time_boot_ms);
20254 __tmp.put_f32_le(self.value);
20255 for val in &self.name {
20256 __tmp.put_u8(*val);
20257 }
20258 if matches!(version, MavlinkVersion::V2) {
20259 let len = __tmp.len();
20260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20261 } else {
20262 __tmp.len()
20263 }
20264 }
20265}
20266#[doc = "id: 252"]
20267#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20268#[derive(Debug, Clone, PartialEq)]
20269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20271pub struct NAMED_VALUE_INT_DATA {
20272 #[doc = "Timestamp (time since system boot)."]
20273 pub time_boot_ms: u32,
20274 #[doc = "Signed integer value"]
20275 pub value: i32,
20276 #[doc = "Name of the debug variable"]
20277 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20278 pub name: [u8; 10],
20279}
20280impl NAMED_VALUE_INT_DATA {
20281 pub const ENCODED_LEN: usize = 18usize;
20282 pub const DEFAULT: Self = Self {
20283 time_boot_ms: 0_u32,
20284 value: 0_i32,
20285 name: [0_u8; 10usize],
20286 };
20287 #[cfg(feature = "arbitrary")]
20288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20289 use arbitrary::{Arbitrary, Unstructured};
20290 let mut buf = [0u8; 1024];
20291 rng.fill_bytes(&mut buf);
20292 let mut unstructured = Unstructured::new(&buf);
20293 Self::arbitrary(&mut unstructured).unwrap_or_default()
20294 }
20295}
20296impl Default for NAMED_VALUE_INT_DATA {
20297 fn default() -> Self {
20298 Self::DEFAULT.clone()
20299 }
20300}
20301impl MessageData for NAMED_VALUE_INT_DATA {
20302 type Message = MavMessage;
20303 const ID: u32 = 252u32;
20304 const NAME: &'static str = "NAMED_VALUE_INT";
20305 const EXTRA_CRC: u8 = 44u8;
20306 const ENCODED_LEN: usize = 18usize;
20307 fn deser(
20308 _version: MavlinkVersion,
20309 __input: &[u8],
20310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20311 let avail_len = __input.len();
20312 let mut payload_buf = [0; Self::ENCODED_LEN];
20313 let mut buf = if avail_len < Self::ENCODED_LEN {
20314 payload_buf[0..avail_len].copy_from_slice(__input);
20315 Bytes::new(&payload_buf)
20316 } else {
20317 Bytes::new(__input)
20318 };
20319 let mut __struct = Self::default();
20320 __struct.time_boot_ms = buf.get_u32_le();
20321 __struct.value = buf.get_i32_le();
20322 for v in &mut __struct.name {
20323 let val = buf.get_u8();
20324 *v = val;
20325 }
20326 Ok(__struct)
20327 }
20328 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20329 let mut __tmp = BytesMut::new(bytes);
20330 #[allow(clippy::absurd_extreme_comparisons)]
20331 #[allow(unused_comparisons)]
20332 if __tmp.remaining() < Self::ENCODED_LEN {
20333 panic!(
20334 "buffer is too small (need {} bytes, but got {})",
20335 Self::ENCODED_LEN,
20336 __tmp.remaining(),
20337 )
20338 }
20339 __tmp.put_u32_le(self.time_boot_ms);
20340 __tmp.put_i32_le(self.value);
20341 for val in &self.name {
20342 __tmp.put_u8(*val);
20343 }
20344 if matches!(version, MavlinkVersion::V2) {
20345 let len = __tmp.len();
20346 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20347 } else {
20348 __tmp.len()
20349 }
20350 }
20351}
20352#[doc = "id: 62"]
20353#[doc = "The state of the navigation and position controller."]
20354#[derive(Debug, Clone, PartialEq)]
20355#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20356#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20357pub struct NAV_CONTROLLER_OUTPUT_DATA {
20358 #[doc = "Current desired roll"]
20359 pub nav_roll: f32,
20360 #[doc = "Current desired pitch"]
20361 pub nav_pitch: f32,
20362 #[doc = "Current altitude error"]
20363 pub alt_error: f32,
20364 #[doc = "Current airspeed error"]
20365 pub aspd_error: f32,
20366 #[doc = "Current crosstrack error on x-y plane"]
20367 pub xtrack_error: f32,
20368 #[doc = "Current desired heading"]
20369 pub nav_bearing: i16,
20370 #[doc = "Bearing to current waypoint/target"]
20371 pub target_bearing: i16,
20372 #[doc = "Distance to active waypoint"]
20373 pub wp_dist: u16,
20374}
20375impl NAV_CONTROLLER_OUTPUT_DATA {
20376 pub const ENCODED_LEN: usize = 26usize;
20377 pub const DEFAULT: Self = Self {
20378 nav_roll: 0.0_f32,
20379 nav_pitch: 0.0_f32,
20380 alt_error: 0.0_f32,
20381 aspd_error: 0.0_f32,
20382 xtrack_error: 0.0_f32,
20383 nav_bearing: 0_i16,
20384 target_bearing: 0_i16,
20385 wp_dist: 0_u16,
20386 };
20387 #[cfg(feature = "arbitrary")]
20388 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20389 use arbitrary::{Arbitrary, Unstructured};
20390 let mut buf = [0u8; 1024];
20391 rng.fill_bytes(&mut buf);
20392 let mut unstructured = Unstructured::new(&buf);
20393 Self::arbitrary(&mut unstructured).unwrap_or_default()
20394 }
20395}
20396impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20397 fn default() -> Self {
20398 Self::DEFAULT.clone()
20399 }
20400}
20401impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20402 type Message = MavMessage;
20403 const ID: u32 = 62u32;
20404 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20405 const EXTRA_CRC: u8 = 183u8;
20406 const ENCODED_LEN: usize = 26usize;
20407 fn deser(
20408 _version: MavlinkVersion,
20409 __input: &[u8],
20410 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20411 let avail_len = __input.len();
20412 let mut payload_buf = [0; Self::ENCODED_LEN];
20413 let mut buf = if avail_len < Self::ENCODED_LEN {
20414 payload_buf[0..avail_len].copy_from_slice(__input);
20415 Bytes::new(&payload_buf)
20416 } else {
20417 Bytes::new(__input)
20418 };
20419 let mut __struct = Self::default();
20420 __struct.nav_roll = buf.get_f32_le();
20421 __struct.nav_pitch = buf.get_f32_le();
20422 __struct.alt_error = buf.get_f32_le();
20423 __struct.aspd_error = buf.get_f32_le();
20424 __struct.xtrack_error = buf.get_f32_le();
20425 __struct.nav_bearing = buf.get_i16_le();
20426 __struct.target_bearing = buf.get_i16_le();
20427 __struct.wp_dist = buf.get_u16_le();
20428 Ok(__struct)
20429 }
20430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20431 let mut __tmp = BytesMut::new(bytes);
20432 #[allow(clippy::absurd_extreme_comparisons)]
20433 #[allow(unused_comparisons)]
20434 if __tmp.remaining() < Self::ENCODED_LEN {
20435 panic!(
20436 "buffer is too small (need {} bytes, but got {})",
20437 Self::ENCODED_LEN,
20438 __tmp.remaining(),
20439 )
20440 }
20441 __tmp.put_f32_le(self.nav_roll);
20442 __tmp.put_f32_le(self.nav_pitch);
20443 __tmp.put_f32_le(self.alt_error);
20444 __tmp.put_f32_le(self.aspd_error);
20445 __tmp.put_f32_le(self.xtrack_error);
20446 __tmp.put_i16_le(self.nav_bearing);
20447 __tmp.put_i16_le(self.target_bearing);
20448 __tmp.put_u16_le(self.wp_dist);
20449 if matches!(version, MavlinkVersion::V2) {
20450 let len = __tmp.len();
20451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20452 } else {
20453 __tmp.len()
20454 }
20455 }
20456}
20457#[doc = "id: 330"]
20458#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20459#[derive(Debug, Clone, PartialEq)]
20460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20462pub struct OBSTACLE_DISTANCE_DATA {
20463 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20464 pub time_usec: u64,
20465 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20467 pub distances: [u16; 72],
20468 #[doc = "Minimum distance the sensor can measure."]
20469 pub min_distance: u16,
20470 #[doc = "Maximum distance the sensor can measure."]
20471 pub max_distance: u16,
20472 #[doc = "Class id of the distance sensor type."]
20473 pub sensor_type: MavDistanceSensor,
20474 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20475 pub increment: u8,
20476 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20477 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20478 pub increment_f: f32,
20479 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20480 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20481 pub angle_offset: f32,
20482 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20483 #[cfg_attr(feature = "serde", serde(default))]
20484 pub frame: MavFrame,
20485}
20486impl OBSTACLE_DISTANCE_DATA {
20487 pub const ENCODED_LEN: usize = 167usize;
20488 pub const DEFAULT: Self = Self {
20489 time_usec: 0_u64,
20490 distances: [0_u16; 72usize],
20491 min_distance: 0_u16,
20492 max_distance: 0_u16,
20493 sensor_type: MavDistanceSensor::DEFAULT,
20494 increment: 0_u8,
20495 increment_f: 0.0_f32,
20496 angle_offset: 0.0_f32,
20497 frame: MavFrame::DEFAULT,
20498 };
20499 #[cfg(feature = "arbitrary")]
20500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20501 use arbitrary::{Arbitrary, Unstructured};
20502 let mut buf = [0u8; 1024];
20503 rng.fill_bytes(&mut buf);
20504 let mut unstructured = Unstructured::new(&buf);
20505 Self::arbitrary(&mut unstructured).unwrap_or_default()
20506 }
20507}
20508impl Default for OBSTACLE_DISTANCE_DATA {
20509 fn default() -> Self {
20510 Self::DEFAULT.clone()
20511 }
20512}
20513impl MessageData for OBSTACLE_DISTANCE_DATA {
20514 type Message = MavMessage;
20515 const ID: u32 = 330u32;
20516 const NAME: &'static str = "OBSTACLE_DISTANCE";
20517 const EXTRA_CRC: u8 = 23u8;
20518 const ENCODED_LEN: usize = 167usize;
20519 fn deser(
20520 _version: MavlinkVersion,
20521 __input: &[u8],
20522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20523 let avail_len = __input.len();
20524 let mut payload_buf = [0; Self::ENCODED_LEN];
20525 let mut buf = if avail_len < Self::ENCODED_LEN {
20526 payload_buf[0..avail_len].copy_from_slice(__input);
20527 Bytes::new(&payload_buf)
20528 } else {
20529 Bytes::new(__input)
20530 };
20531 let mut __struct = Self::default();
20532 __struct.time_usec = buf.get_u64_le();
20533 for v in &mut __struct.distances {
20534 let val = buf.get_u16_le();
20535 *v = val;
20536 }
20537 __struct.min_distance = buf.get_u16_le();
20538 __struct.max_distance = buf.get_u16_le();
20539 let tmp = buf.get_u8();
20540 __struct.sensor_type =
20541 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20542 enum_type: "MavDistanceSensor",
20543 value: tmp as u32,
20544 })?;
20545 __struct.increment = buf.get_u8();
20546 __struct.increment_f = buf.get_f32_le();
20547 __struct.angle_offset = buf.get_f32_le();
20548 let tmp = buf.get_u8();
20549 __struct.frame =
20550 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20551 enum_type: "MavFrame",
20552 value: tmp as u32,
20553 })?;
20554 Ok(__struct)
20555 }
20556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20557 let mut __tmp = BytesMut::new(bytes);
20558 #[allow(clippy::absurd_extreme_comparisons)]
20559 #[allow(unused_comparisons)]
20560 if __tmp.remaining() < Self::ENCODED_LEN {
20561 panic!(
20562 "buffer is too small (need {} bytes, but got {})",
20563 Self::ENCODED_LEN,
20564 __tmp.remaining(),
20565 )
20566 }
20567 __tmp.put_u64_le(self.time_usec);
20568 for val in &self.distances {
20569 __tmp.put_u16_le(*val);
20570 }
20571 __tmp.put_u16_le(self.min_distance);
20572 __tmp.put_u16_le(self.max_distance);
20573 __tmp.put_u8(self.sensor_type as u8);
20574 __tmp.put_u8(self.increment);
20575 __tmp.put_f32_le(self.increment_f);
20576 __tmp.put_f32_le(self.angle_offset);
20577 __tmp.put_u8(self.frame as u8);
20578 if matches!(version, MavlinkVersion::V2) {
20579 let len = __tmp.len();
20580 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20581 } else {
20582 __tmp.len()
20583 }
20584 }
20585}
20586#[doc = "id: 331"]
20587#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20588#[derive(Debug, Clone, PartialEq)]
20589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20591pub struct ODOMETRY_DATA {
20592 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20593 pub time_usec: u64,
20594 #[doc = "X Position"]
20595 pub x: f32,
20596 #[doc = "Y Position"]
20597 pub y: f32,
20598 #[doc = "Z Position"]
20599 pub z: f32,
20600 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20602 pub q: [f32; 4],
20603 #[doc = "X linear speed"]
20604 pub vx: f32,
20605 #[doc = "Y linear speed"]
20606 pub vy: f32,
20607 #[doc = "Z linear speed"]
20608 pub vz: f32,
20609 #[doc = "Roll angular speed"]
20610 pub rollspeed: f32,
20611 #[doc = "Pitch angular speed"]
20612 pub pitchspeed: f32,
20613 #[doc = "Yaw angular speed"]
20614 pub yawspeed: f32,
20615 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20616 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20617 pub pose_covariance: [f32; 21],
20618 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20619 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20620 pub velocity_covariance: [f32; 21],
20621 #[doc = "Coordinate frame of reference for the pose data."]
20622 pub frame_id: MavFrame,
20623 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20624 pub child_frame_id: MavFrame,
20625 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20626 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20627 pub reset_counter: u8,
20628 #[doc = "Type of estimator that is providing the odometry."]
20629 #[cfg_attr(feature = "serde", serde(default))]
20630 pub estimator_type: MavEstimatorType,
20631 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20632 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20633 pub quality: i8,
20634}
20635impl ODOMETRY_DATA {
20636 pub const ENCODED_LEN: usize = 233usize;
20637 pub const DEFAULT: Self = Self {
20638 time_usec: 0_u64,
20639 x: 0.0_f32,
20640 y: 0.0_f32,
20641 z: 0.0_f32,
20642 q: [0.0_f32; 4usize],
20643 vx: 0.0_f32,
20644 vy: 0.0_f32,
20645 vz: 0.0_f32,
20646 rollspeed: 0.0_f32,
20647 pitchspeed: 0.0_f32,
20648 yawspeed: 0.0_f32,
20649 pose_covariance: [0.0_f32; 21usize],
20650 velocity_covariance: [0.0_f32; 21usize],
20651 frame_id: MavFrame::DEFAULT,
20652 child_frame_id: MavFrame::DEFAULT,
20653 reset_counter: 0_u8,
20654 estimator_type: MavEstimatorType::DEFAULT,
20655 quality: 0_i8,
20656 };
20657 #[cfg(feature = "arbitrary")]
20658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20659 use arbitrary::{Arbitrary, Unstructured};
20660 let mut buf = [0u8; 1024];
20661 rng.fill_bytes(&mut buf);
20662 let mut unstructured = Unstructured::new(&buf);
20663 Self::arbitrary(&mut unstructured).unwrap_or_default()
20664 }
20665}
20666impl Default for ODOMETRY_DATA {
20667 fn default() -> Self {
20668 Self::DEFAULT.clone()
20669 }
20670}
20671impl MessageData for ODOMETRY_DATA {
20672 type Message = MavMessage;
20673 const ID: u32 = 331u32;
20674 const NAME: &'static str = "ODOMETRY";
20675 const EXTRA_CRC: u8 = 91u8;
20676 const ENCODED_LEN: usize = 233usize;
20677 fn deser(
20678 _version: MavlinkVersion,
20679 __input: &[u8],
20680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20681 let avail_len = __input.len();
20682 let mut payload_buf = [0; Self::ENCODED_LEN];
20683 let mut buf = if avail_len < Self::ENCODED_LEN {
20684 payload_buf[0..avail_len].copy_from_slice(__input);
20685 Bytes::new(&payload_buf)
20686 } else {
20687 Bytes::new(__input)
20688 };
20689 let mut __struct = Self::default();
20690 __struct.time_usec = buf.get_u64_le();
20691 __struct.x = buf.get_f32_le();
20692 __struct.y = buf.get_f32_le();
20693 __struct.z = buf.get_f32_le();
20694 for v in &mut __struct.q {
20695 let val = buf.get_f32_le();
20696 *v = val;
20697 }
20698 __struct.vx = buf.get_f32_le();
20699 __struct.vy = buf.get_f32_le();
20700 __struct.vz = buf.get_f32_le();
20701 __struct.rollspeed = buf.get_f32_le();
20702 __struct.pitchspeed = buf.get_f32_le();
20703 __struct.yawspeed = buf.get_f32_le();
20704 for v in &mut __struct.pose_covariance {
20705 let val = buf.get_f32_le();
20706 *v = val;
20707 }
20708 for v in &mut __struct.velocity_covariance {
20709 let val = buf.get_f32_le();
20710 *v = val;
20711 }
20712 let tmp = buf.get_u8();
20713 __struct.frame_id =
20714 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20715 enum_type: "MavFrame",
20716 value: tmp as u32,
20717 })?;
20718 let tmp = buf.get_u8();
20719 __struct.child_frame_id =
20720 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20721 enum_type: "MavFrame",
20722 value: tmp as u32,
20723 })?;
20724 __struct.reset_counter = buf.get_u8();
20725 let tmp = buf.get_u8();
20726 __struct.estimator_type =
20727 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20728 enum_type: "MavEstimatorType",
20729 value: tmp as u32,
20730 })?;
20731 __struct.quality = buf.get_i8();
20732 Ok(__struct)
20733 }
20734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20735 let mut __tmp = BytesMut::new(bytes);
20736 #[allow(clippy::absurd_extreme_comparisons)]
20737 #[allow(unused_comparisons)]
20738 if __tmp.remaining() < Self::ENCODED_LEN {
20739 panic!(
20740 "buffer is too small (need {} bytes, but got {})",
20741 Self::ENCODED_LEN,
20742 __tmp.remaining(),
20743 )
20744 }
20745 __tmp.put_u64_le(self.time_usec);
20746 __tmp.put_f32_le(self.x);
20747 __tmp.put_f32_le(self.y);
20748 __tmp.put_f32_le(self.z);
20749 for val in &self.q {
20750 __tmp.put_f32_le(*val);
20751 }
20752 __tmp.put_f32_le(self.vx);
20753 __tmp.put_f32_le(self.vy);
20754 __tmp.put_f32_le(self.vz);
20755 __tmp.put_f32_le(self.rollspeed);
20756 __tmp.put_f32_le(self.pitchspeed);
20757 __tmp.put_f32_le(self.yawspeed);
20758 for val in &self.pose_covariance {
20759 __tmp.put_f32_le(*val);
20760 }
20761 for val in &self.velocity_covariance {
20762 __tmp.put_f32_le(*val);
20763 }
20764 __tmp.put_u8(self.frame_id as u8);
20765 __tmp.put_u8(self.child_frame_id as u8);
20766 __tmp.put_u8(self.reset_counter);
20767 __tmp.put_u8(self.estimator_type as u8);
20768 __tmp.put_i8(self.quality);
20769 if matches!(version, MavlinkVersion::V2) {
20770 let len = __tmp.len();
20771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20772 } else {
20773 __tmp.len()
20774 }
20775 }
20776}
20777#[doc = "id: 390"]
20778#[doc = "Hardware status sent by an onboard computer."]
20779#[derive(Debug, Clone, PartialEq)]
20780#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20782pub struct ONBOARD_COMPUTER_STATUS_DATA {
20783 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20784 pub time_usec: u64,
20785 #[doc = "Time since system boot."]
20786 pub uptime: u32,
20787 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20788 pub ram_usage: u32,
20789 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20790 pub ram_total: u32,
20791 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
20792 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20793 pub storage_type: [u32; 4],
20794 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20796 pub storage_usage: [u32; 4],
20797 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20798 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20799 pub storage_total: [u32; 4],
20800 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
20801 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20802 pub link_type: [u32; 6],
20803 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
20804 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20805 pub link_tx_rate: [u32; 6],
20806 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
20807 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20808 pub link_rx_rate: [u32; 6],
20809 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
20810 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20811 pub link_tx_max: [u32; 6],
20812 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
20813 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20814 pub link_rx_max: [u32; 6],
20815 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
20816 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20817 pub fan_speed: [i16; 4],
20818 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
20819 pub mavtype: u8,
20820 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20821 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20822 pub cpu_cores: [u8; 8],
20823 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20824 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20825 pub cpu_combined: [u8; 10],
20826 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20828 pub gpu_cores: [u8; 4],
20829 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20830 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20831 pub gpu_combined: [u8; 10],
20832 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
20833 pub temperature_board: i8,
20834 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
20835 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20836 pub temperature_core: [i8; 8],
20837}
20838impl ONBOARD_COMPUTER_STATUS_DATA {
20839 pub const ENCODED_LEN: usize = 238usize;
20840 pub const DEFAULT: Self = Self {
20841 time_usec: 0_u64,
20842 uptime: 0_u32,
20843 ram_usage: 0_u32,
20844 ram_total: 0_u32,
20845 storage_type: [0_u32; 4usize],
20846 storage_usage: [0_u32; 4usize],
20847 storage_total: [0_u32; 4usize],
20848 link_type: [0_u32; 6usize],
20849 link_tx_rate: [0_u32; 6usize],
20850 link_rx_rate: [0_u32; 6usize],
20851 link_tx_max: [0_u32; 6usize],
20852 link_rx_max: [0_u32; 6usize],
20853 fan_speed: [0_i16; 4usize],
20854 mavtype: 0_u8,
20855 cpu_cores: [0_u8; 8usize],
20856 cpu_combined: [0_u8; 10usize],
20857 gpu_cores: [0_u8; 4usize],
20858 gpu_combined: [0_u8; 10usize],
20859 temperature_board: 0_i8,
20860 temperature_core: [0_i8; 8usize],
20861 };
20862 #[cfg(feature = "arbitrary")]
20863 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20864 use arbitrary::{Arbitrary, Unstructured};
20865 let mut buf = [0u8; 1024];
20866 rng.fill_bytes(&mut buf);
20867 let mut unstructured = Unstructured::new(&buf);
20868 Self::arbitrary(&mut unstructured).unwrap_or_default()
20869 }
20870}
20871impl Default for ONBOARD_COMPUTER_STATUS_DATA {
20872 fn default() -> Self {
20873 Self::DEFAULT.clone()
20874 }
20875}
20876impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
20877 type Message = MavMessage;
20878 const ID: u32 = 390u32;
20879 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
20880 const EXTRA_CRC: u8 = 156u8;
20881 const ENCODED_LEN: usize = 238usize;
20882 fn deser(
20883 _version: MavlinkVersion,
20884 __input: &[u8],
20885 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20886 let avail_len = __input.len();
20887 let mut payload_buf = [0; Self::ENCODED_LEN];
20888 let mut buf = if avail_len < Self::ENCODED_LEN {
20889 payload_buf[0..avail_len].copy_from_slice(__input);
20890 Bytes::new(&payload_buf)
20891 } else {
20892 Bytes::new(__input)
20893 };
20894 let mut __struct = Self::default();
20895 __struct.time_usec = buf.get_u64_le();
20896 __struct.uptime = buf.get_u32_le();
20897 __struct.ram_usage = buf.get_u32_le();
20898 __struct.ram_total = buf.get_u32_le();
20899 for v in &mut __struct.storage_type {
20900 let val = buf.get_u32_le();
20901 *v = val;
20902 }
20903 for v in &mut __struct.storage_usage {
20904 let val = buf.get_u32_le();
20905 *v = val;
20906 }
20907 for v in &mut __struct.storage_total {
20908 let val = buf.get_u32_le();
20909 *v = val;
20910 }
20911 for v in &mut __struct.link_type {
20912 let val = buf.get_u32_le();
20913 *v = val;
20914 }
20915 for v in &mut __struct.link_tx_rate {
20916 let val = buf.get_u32_le();
20917 *v = val;
20918 }
20919 for v in &mut __struct.link_rx_rate {
20920 let val = buf.get_u32_le();
20921 *v = val;
20922 }
20923 for v in &mut __struct.link_tx_max {
20924 let val = buf.get_u32_le();
20925 *v = val;
20926 }
20927 for v in &mut __struct.link_rx_max {
20928 let val = buf.get_u32_le();
20929 *v = val;
20930 }
20931 for v in &mut __struct.fan_speed {
20932 let val = buf.get_i16_le();
20933 *v = val;
20934 }
20935 __struct.mavtype = buf.get_u8();
20936 for v in &mut __struct.cpu_cores {
20937 let val = buf.get_u8();
20938 *v = val;
20939 }
20940 for v in &mut __struct.cpu_combined {
20941 let val = buf.get_u8();
20942 *v = val;
20943 }
20944 for v in &mut __struct.gpu_cores {
20945 let val = buf.get_u8();
20946 *v = val;
20947 }
20948 for v in &mut __struct.gpu_combined {
20949 let val = buf.get_u8();
20950 *v = val;
20951 }
20952 __struct.temperature_board = buf.get_i8();
20953 for v in &mut __struct.temperature_core {
20954 let val = buf.get_i8();
20955 *v = val;
20956 }
20957 Ok(__struct)
20958 }
20959 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20960 let mut __tmp = BytesMut::new(bytes);
20961 #[allow(clippy::absurd_extreme_comparisons)]
20962 #[allow(unused_comparisons)]
20963 if __tmp.remaining() < Self::ENCODED_LEN {
20964 panic!(
20965 "buffer is too small (need {} bytes, but got {})",
20966 Self::ENCODED_LEN,
20967 __tmp.remaining(),
20968 )
20969 }
20970 __tmp.put_u64_le(self.time_usec);
20971 __tmp.put_u32_le(self.uptime);
20972 __tmp.put_u32_le(self.ram_usage);
20973 __tmp.put_u32_le(self.ram_total);
20974 for val in &self.storage_type {
20975 __tmp.put_u32_le(*val);
20976 }
20977 for val in &self.storage_usage {
20978 __tmp.put_u32_le(*val);
20979 }
20980 for val in &self.storage_total {
20981 __tmp.put_u32_le(*val);
20982 }
20983 for val in &self.link_type {
20984 __tmp.put_u32_le(*val);
20985 }
20986 for val in &self.link_tx_rate {
20987 __tmp.put_u32_le(*val);
20988 }
20989 for val in &self.link_rx_rate {
20990 __tmp.put_u32_le(*val);
20991 }
20992 for val in &self.link_tx_max {
20993 __tmp.put_u32_le(*val);
20994 }
20995 for val in &self.link_rx_max {
20996 __tmp.put_u32_le(*val);
20997 }
20998 for val in &self.fan_speed {
20999 __tmp.put_i16_le(*val);
21000 }
21001 __tmp.put_u8(self.mavtype);
21002 for val in &self.cpu_cores {
21003 __tmp.put_u8(*val);
21004 }
21005 for val in &self.cpu_combined {
21006 __tmp.put_u8(*val);
21007 }
21008 for val in &self.gpu_cores {
21009 __tmp.put_u8(*val);
21010 }
21011 for val in &self.gpu_combined {
21012 __tmp.put_u8(*val);
21013 }
21014 __tmp.put_i8(self.temperature_board);
21015 for val in &self.temperature_core {
21016 __tmp.put_i8(*val);
21017 }
21018 if matches!(version, MavlinkVersion::V2) {
21019 let len = __tmp.len();
21020 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21021 } else {
21022 __tmp.len()
21023 }
21024 }
21025}
21026#[doc = "id: 12918"]
21027#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21028#[derive(Debug, Clone, PartialEq)]
21029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21031pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21032 #[doc = "Status level indicating if arming is allowed."]
21033 pub status: MavOdidArmStatus,
21034 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21035 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21036 pub error: [u8; 50],
21037}
21038impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21039 pub const ENCODED_LEN: usize = 51usize;
21040 pub const DEFAULT: Self = Self {
21041 status: MavOdidArmStatus::DEFAULT,
21042 error: [0_u8; 50usize],
21043 };
21044 #[cfg(feature = "arbitrary")]
21045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21046 use arbitrary::{Arbitrary, Unstructured};
21047 let mut buf = [0u8; 1024];
21048 rng.fill_bytes(&mut buf);
21049 let mut unstructured = Unstructured::new(&buf);
21050 Self::arbitrary(&mut unstructured).unwrap_or_default()
21051 }
21052}
21053impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21054 fn default() -> Self {
21055 Self::DEFAULT.clone()
21056 }
21057}
21058impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21059 type Message = MavMessage;
21060 const ID: u32 = 12918u32;
21061 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21062 const EXTRA_CRC: u8 = 139u8;
21063 const ENCODED_LEN: usize = 51usize;
21064 fn deser(
21065 _version: MavlinkVersion,
21066 __input: &[u8],
21067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21068 let avail_len = __input.len();
21069 let mut payload_buf = [0; Self::ENCODED_LEN];
21070 let mut buf = if avail_len < Self::ENCODED_LEN {
21071 payload_buf[0..avail_len].copy_from_slice(__input);
21072 Bytes::new(&payload_buf)
21073 } else {
21074 Bytes::new(__input)
21075 };
21076 let mut __struct = Self::default();
21077 let tmp = buf.get_u8();
21078 __struct.status =
21079 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21080 enum_type: "MavOdidArmStatus",
21081 value: tmp as u32,
21082 })?;
21083 for v in &mut __struct.error {
21084 let val = buf.get_u8();
21085 *v = val;
21086 }
21087 Ok(__struct)
21088 }
21089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21090 let mut __tmp = BytesMut::new(bytes);
21091 #[allow(clippy::absurd_extreme_comparisons)]
21092 #[allow(unused_comparisons)]
21093 if __tmp.remaining() < Self::ENCODED_LEN {
21094 panic!(
21095 "buffer is too small (need {} bytes, but got {})",
21096 Self::ENCODED_LEN,
21097 __tmp.remaining(),
21098 )
21099 }
21100 __tmp.put_u8(self.status as u8);
21101 for val in &self.error {
21102 __tmp.put_u8(*val);
21103 }
21104 if matches!(version, MavlinkVersion::V2) {
21105 let len = __tmp.len();
21106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21107 } else {
21108 __tmp.len()
21109 }
21110 }
21111}
21112#[doc = "id: 12902"]
21113#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21114#[derive(Debug, Clone, PartialEq)]
21115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21117pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21118 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21119 pub timestamp: u32,
21120 #[doc = "System ID (0 for broadcast)."]
21121 pub target_system: u8,
21122 #[doc = "Component ID (0 for broadcast)."]
21123 pub target_component: u8,
21124 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21125 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21126 pub id_or_mac: [u8; 20],
21127 #[doc = "Indicates the type of authentication."]
21128 pub authentication_type: MavOdidAuthType,
21129 #[doc = "Allowed range is 0 - 15."]
21130 pub data_page: u8,
21131 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21132 pub last_page_index: u8,
21133 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21134 pub length: u8,
21135 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21136 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21137 pub authentication_data: [u8; 23],
21138}
21139impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21140 pub const ENCODED_LEN: usize = 53usize;
21141 pub const DEFAULT: Self = Self {
21142 timestamp: 0_u32,
21143 target_system: 0_u8,
21144 target_component: 0_u8,
21145 id_or_mac: [0_u8; 20usize],
21146 authentication_type: MavOdidAuthType::DEFAULT,
21147 data_page: 0_u8,
21148 last_page_index: 0_u8,
21149 length: 0_u8,
21150 authentication_data: [0_u8; 23usize],
21151 };
21152 #[cfg(feature = "arbitrary")]
21153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21154 use arbitrary::{Arbitrary, Unstructured};
21155 let mut buf = [0u8; 1024];
21156 rng.fill_bytes(&mut buf);
21157 let mut unstructured = Unstructured::new(&buf);
21158 Self::arbitrary(&mut unstructured).unwrap_or_default()
21159 }
21160}
21161impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21162 fn default() -> Self {
21163 Self::DEFAULT.clone()
21164 }
21165}
21166impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21167 type Message = MavMessage;
21168 const ID: u32 = 12902u32;
21169 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21170 const EXTRA_CRC: u8 = 140u8;
21171 const ENCODED_LEN: usize = 53usize;
21172 fn deser(
21173 _version: MavlinkVersion,
21174 __input: &[u8],
21175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21176 let avail_len = __input.len();
21177 let mut payload_buf = [0; Self::ENCODED_LEN];
21178 let mut buf = if avail_len < Self::ENCODED_LEN {
21179 payload_buf[0..avail_len].copy_from_slice(__input);
21180 Bytes::new(&payload_buf)
21181 } else {
21182 Bytes::new(__input)
21183 };
21184 let mut __struct = Self::default();
21185 __struct.timestamp = buf.get_u32_le();
21186 __struct.target_system = buf.get_u8();
21187 __struct.target_component = buf.get_u8();
21188 for v in &mut __struct.id_or_mac {
21189 let val = buf.get_u8();
21190 *v = val;
21191 }
21192 let tmp = buf.get_u8();
21193 __struct.authentication_type =
21194 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21195 enum_type: "MavOdidAuthType",
21196 value: tmp as u32,
21197 })?;
21198 __struct.data_page = buf.get_u8();
21199 __struct.last_page_index = buf.get_u8();
21200 __struct.length = buf.get_u8();
21201 for v in &mut __struct.authentication_data {
21202 let val = buf.get_u8();
21203 *v = val;
21204 }
21205 Ok(__struct)
21206 }
21207 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21208 let mut __tmp = BytesMut::new(bytes);
21209 #[allow(clippy::absurd_extreme_comparisons)]
21210 #[allow(unused_comparisons)]
21211 if __tmp.remaining() < Self::ENCODED_LEN {
21212 panic!(
21213 "buffer is too small (need {} bytes, but got {})",
21214 Self::ENCODED_LEN,
21215 __tmp.remaining(),
21216 )
21217 }
21218 __tmp.put_u32_le(self.timestamp);
21219 __tmp.put_u8(self.target_system);
21220 __tmp.put_u8(self.target_component);
21221 for val in &self.id_or_mac {
21222 __tmp.put_u8(*val);
21223 }
21224 __tmp.put_u8(self.authentication_type as u8);
21225 __tmp.put_u8(self.data_page);
21226 __tmp.put_u8(self.last_page_index);
21227 __tmp.put_u8(self.length);
21228 for val in &self.authentication_data {
21229 __tmp.put_u8(*val);
21230 }
21231 if matches!(version, MavlinkVersion::V2) {
21232 let len = __tmp.len();
21233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21234 } else {
21235 __tmp.len()
21236 }
21237 }
21238}
21239#[doc = "id: 12900"]
21240#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21241#[derive(Debug, Clone, PartialEq)]
21242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21244pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21245 #[doc = "System ID (0 for broadcast)."]
21246 pub target_system: u8,
21247 #[doc = "Component ID (0 for broadcast)."]
21248 pub target_component: u8,
21249 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21250 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21251 pub id_or_mac: [u8; 20],
21252 #[doc = "Indicates the format for the uas_id field of this message."]
21253 pub id_type: MavOdidIdType,
21254 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21255 pub ua_type: MavOdidUaType,
21256 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21257 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21258 pub uas_id: [u8; 20],
21259}
21260impl OPEN_DRONE_ID_BASIC_ID_DATA {
21261 pub const ENCODED_LEN: usize = 44usize;
21262 pub const DEFAULT: Self = Self {
21263 target_system: 0_u8,
21264 target_component: 0_u8,
21265 id_or_mac: [0_u8; 20usize],
21266 id_type: MavOdidIdType::DEFAULT,
21267 ua_type: MavOdidUaType::DEFAULT,
21268 uas_id: [0_u8; 20usize],
21269 };
21270 #[cfg(feature = "arbitrary")]
21271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21272 use arbitrary::{Arbitrary, Unstructured};
21273 let mut buf = [0u8; 1024];
21274 rng.fill_bytes(&mut buf);
21275 let mut unstructured = Unstructured::new(&buf);
21276 Self::arbitrary(&mut unstructured).unwrap_or_default()
21277 }
21278}
21279impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21280 fn default() -> Self {
21281 Self::DEFAULT.clone()
21282 }
21283}
21284impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21285 type Message = MavMessage;
21286 const ID: u32 = 12900u32;
21287 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21288 const EXTRA_CRC: u8 = 114u8;
21289 const ENCODED_LEN: usize = 44usize;
21290 fn deser(
21291 _version: MavlinkVersion,
21292 __input: &[u8],
21293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21294 let avail_len = __input.len();
21295 let mut payload_buf = [0; Self::ENCODED_LEN];
21296 let mut buf = if avail_len < Self::ENCODED_LEN {
21297 payload_buf[0..avail_len].copy_from_slice(__input);
21298 Bytes::new(&payload_buf)
21299 } else {
21300 Bytes::new(__input)
21301 };
21302 let mut __struct = Self::default();
21303 __struct.target_system = buf.get_u8();
21304 __struct.target_component = buf.get_u8();
21305 for v in &mut __struct.id_or_mac {
21306 let val = buf.get_u8();
21307 *v = val;
21308 }
21309 let tmp = buf.get_u8();
21310 __struct.id_type =
21311 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21312 enum_type: "MavOdidIdType",
21313 value: tmp as u32,
21314 })?;
21315 let tmp = buf.get_u8();
21316 __struct.ua_type =
21317 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21318 enum_type: "MavOdidUaType",
21319 value: tmp as u32,
21320 })?;
21321 for v in &mut __struct.uas_id {
21322 let val = buf.get_u8();
21323 *v = val;
21324 }
21325 Ok(__struct)
21326 }
21327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21328 let mut __tmp = BytesMut::new(bytes);
21329 #[allow(clippy::absurd_extreme_comparisons)]
21330 #[allow(unused_comparisons)]
21331 if __tmp.remaining() < Self::ENCODED_LEN {
21332 panic!(
21333 "buffer is too small (need {} bytes, but got {})",
21334 Self::ENCODED_LEN,
21335 __tmp.remaining(),
21336 )
21337 }
21338 __tmp.put_u8(self.target_system);
21339 __tmp.put_u8(self.target_component);
21340 for val in &self.id_or_mac {
21341 __tmp.put_u8(*val);
21342 }
21343 __tmp.put_u8(self.id_type as u8);
21344 __tmp.put_u8(self.ua_type as u8);
21345 for val in &self.uas_id {
21346 __tmp.put_u8(*val);
21347 }
21348 if matches!(version, MavlinkVersion::V2) {
21349 let len = __tmp.len();
21350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21351 } else {
21352 __tmp.len()
21353 }
21354 }
21355}
21356#[doc = "id: 12901"]
21357#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21358#[derive(Debug, Clone, PartialEq)]
21359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21360#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21361pub struct OPEN_DRONE_ID_LOCATION_DATA {
21362 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21363 pub latitude: i32,
21364 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21365 pub longitude: i32,
21366 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21367 pub altitude_barometric: f32,
21368 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21369 pub altitude_geodetic: f32,
21370 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21371 pub height: f32,
21372 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21373 pub timestamp: f32,
21374 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21375 pub direction: u16,
21376 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21377 pub speed_horizontal: u16,
21378 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21379 pub speed_vertical: i16,
21380 #[doc = "System ID (0 for broadcast)."]
21381 pub target_system: u8,
21382 #[doc = "Component ID (0 for broadcast)."]
21383 pub target_component: u8,
21384 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21386 pub id_or_mac: [u8; 20],
21387 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21388 pub status: MavOdidStatus,
21389 #[doc = "Indicates the reference point for the height field."]
21390 pub height_reference: MavOdidHeightRef,
21391 #[doc = "The accuracy of the horizontal position."]
21392 pub horizontal_accuracy: MavOdidHorAcc,
21393 #[doc = "The accuracy of the vertical position."]
21394 pub vertical_accuracy: MavOdidVerAcc,
21395 #[doc = "The accuracy of the barometric altitude."]
21396 pub barometer_accuracy: MavOdidVerAcc,
21397 #[doc = "The accuracy of the horizontal and vertical speed."]
21398 pub speed_accuracy: MavOdidSpeedAcc,
21399 #[doc = "The accuracy of the timestamps."]
21400 pub timestamp_accuracy: MavOdidTimeAcc,
21401}
21402impl OPEN_DRONE_ID_LOCATION_DATA {
21403 pub const ENCODED_LEN: usize = 59usize;
21404 pub const DEFAULT: Self = Self {
21405 latitude: 0_i32,
21406 longitude: 0_i32,
21407 altitude_barometric: 0.0_f32,
21408 altitude_geodetic: 0.0_f32,
21409 height: 0.0_f32,
21410 timestamp: 0.0_f32,
21411 direction: 0_u16,
21412 speed_horizontal: 0_u16,
21413 speed_vertical: 0_i16,
21414 target_system: 0_u8,
21415 target_component: 0_u8,
21416 id_or_mac: [0_u8; 20usize],
21417 status: MavOdidStatus::DEFAULT,
21418 height_reference: MavOdidHeightRef::DEFAULT,
21419 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21420 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21421 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21422 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21423 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21424 };
21425 #[cfg(feature = "arbitrary")]
21426 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21427 use arbitrary::{Arbitrary, Unstructured};
21428 let mut buf = [0u8; 1024];
21429 rng.fill_bytes(&mut buf);
21430 let mut unstructured = Unstructured::new(&buf);
21431 Self::arbitrary(&mut unstructured).unwrap_or_default()
21432 }
21433}
21434impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21435 fn default() -> Self {
21436 Self::DEFAULT.clone()
21437 }
21438}
21439impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21440 type Message = MavMessage;
21441 const ID: u32 = 12901u32;
21442 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21443 const EXTRA_CRC: u8 = 254u8;
21444 const ENCODED_LEN: usize = 59usize;
21445 fn deser(
21446 _version: MavlinkVersion,
21447 __input: &[u8],
21448 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21449 let avail_len = __input.len();
21450 let mut payload_buf = [0; Self::ENCODED_LEN];
21451 let mut buf = if avail_len < Self::ENCODED_LEN {
21452 payload_buf[0..avail_len].copy_from_slice(__input);
21453 Bytes::new(&payload_buf)
21454 } else {
21455 Bytes::new(__input)
21456 };
21457 let mut __struct = Self::default();
21458 __struct.latitude = buf.get_i32_le();
21459 __struct.longitude = buf.get_i32_le();
21460 __struct.altitude_barometric = buf.get_f32_le();
21461 __struct.altitude_geodetic = buf.get_f32_le();
21462 __struct.height = buf.get_f32_le();
21463 __struct.timestamp = buf.get_f32_le();
21464 __struct.direction = buf.get_u16_le();
21465 __struct.speed_horizontal = buf.get_u16_le();
21466 __struct.speed_vertical = buf.get_i16_le();
21467 __struct.target_system = buf.get_u8();
21468 __struct.target_component = buf.get_u8();
21469 for v in &mut __struct.id_or_mac {
21470 let val = buf.get_u8();
21471 *v = val;
21472 }
21473 let tmp = buf.get_u8();
21474 __struct.status =
21475 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21476 enum_type: "MavOdidStatus",
21477 value: tmp as u32,
21478 })?;
21479 let tmp = buf.get_u8();
21480 __struct.height_reference =
21481 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21482 enum_type: "MavOdidHeightRef",
21483 value: tmp as u32,
21484 })?;
21485 let tmp = buf.get_u8();
21486 __struct.horizontal_accuracy =
21487 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21488 enum_type: "MavOdidHorAcc",
21489 value: tmp as u32,
21490 })?;
21491 let tmp = buf.get_u8();
21492 __struct.vertical_accuracy =
21493 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21494 enum_type: "MavOdidVerAcc",
21495 value: tmp as u32,
21496 })?;
21497 let tmp = buf.get_u8();
21498 __struct.barometer_accuracy =
21499 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21500 enum_type: "MavOdidVerAcc",
21501 value: tmp as u32,
21502 })?;
21503 let tmp = buf.get_u8();
21504 __struct.speed_accuracy =
21505 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21506 enum_type: "MavOdidSpeedAcc",
21507 value: tmp as u32,
21508 })?;
21509 let tmp = buf.get_u8();
21510 __struct.timestamp_accuracy =
21511 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21512 enum_type: "MavOdidTimeAcc",
21513 value: tmp as u32,
21514 })?;
21515 Ok(__struct)
21516 }
21517 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21518 let mut __tmp = BytesMut::new(bytes);
21519 #[allow(clippy::absurd_extreme_comparisons)]
21520 #[allow(unused_comparisons)]
21521 if __tmp.remaining() < Self::ENCODED_LEN {
21522 panic!(
21523 "buffer is too small (need {} bytes, but got {})",
21524 Self::ENCODED_LEN,
21525 __tmp.remaining(),
21526 )
21527 }
21528 __tmp.put_i32_le(self.latitude);
21529 __tmp.put_i32_le(self.longitude);
21530 __tmp.put_f32_le(self.altitude_barometric);
21531 __tmp.put_f32_le(self.altitude_geodetic);
21532 __tmp.put_f32_le(self.height);
21533 __tmp.put_f32_le(self.timestamp);
21534 __tmp.put_u16_le(self.direction);
21535 __tmp.put_u16_le(self.speed_horizontal);
21536 __tmp.put_i16_le(self.speed_vertical);
21537 __tmp.put_u8(self.target_system);
21538 __tmp.put_u8(self.target_component);
21539 for val in &self.id_or_mac {
21540 __tmp.put_u8(*val);
21541 }
21542 __tmp.put_u8(self.status as u8);
21543 __tmp.put_u8(self.height_reference as u8);
21544 __tmp.put_u8(self.horizontal_accuracy as u8);
21545 __tmp.put_u8(self.vertical_accuracy as u8);
21546 __tmp.put_u8(self.barometer_accuracy as u8);
21547 __tmp.put_u8(self.speed_accuracy as u8);
21548 __tmp.put_u8(self.timestamp_accuracy as u8);
21549 if matches!(version, MavlinkVersion::V2) {
21550 let len = __tmp.len();
21551 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21552 } else {
21553 __tmp.len()
21554 }
21555 }
21556}
21557#[doc = "id: 12915"]
21558#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21559#[derive(Debug, Clone, PartialEq)]
21560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21561#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21562pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21563 #[doc = "System ID (0 for broadcast)."]
21564 pub target_system: u8,
21565 #[doc = "Component ID (0 for broadcast)."]
21566 pub target_component: u8,
21567 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21568 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21569 pub id_or_mac: [u8; 20],
21570 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21571 pub single_message_size: u8,
21572 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21573 pub msg_pack_size: u8,
21574 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21575 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21576 pub messages: [u8; 225],
21577}
21578impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21579 pub const ENCODED_LEN: usize = 249usize;
21580 pub const DEFAULT: Self = Self {
21581 target_system: 0_u8,
21582 target_component: 0_u8,
21583 id_or_mac: [0_u8; 20usize],
21584 single_message_size: 0_u8,
21585 msg_pack_size: 0_u8,
21586 messages: [0_u8; 225usize],
21587 };
21588 #[cfg(feature = "arbitrary")]
21589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21590 use arbitrary::{Arbitrary, Unstructured};
21591 let mut buf = [0u8; 1024];
21592 rng.fill_bytes(&mut buf);
21593 let mut unstructured = Unstructured::new(&buf);
21594 Self::arbitrary(&mut unstructured).unwrap_or_default()
21595 }
21596}
21597impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21598 fn default() -> Self {
21599 Self::DEFAULT.clone()
21600 }
21601}
21602impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21603 type Message = MavMessage;
21604 const ID: u32 = 12915u32;
21605 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21606 const EXTRA_CRC: u8 = 94u8;
21607 const ENCODED_LEN: usize = 249usize;
21608 fn deser(
21609 _version: MavlinkVersion,
21610 __input: &[u8],
21611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21612 let avail_len = __input.len();
21613 let mut payload_buf = [0; Self::ENCODED_LEN];
21614 let mut buf = if avail_len < Self::ENCODED_LEN {
21615 payload_buf[0..avail_len].copy_from_slice(__input);
21616 Bytes::new(&payload_buf)
21617 } else {
21618 Bytes::new(__input)
21619 };
21620 let mut __struct = Self::default();
21621 __struct.target_system = buf.get_u8();
21622 __struct.target_component = buf.get_u8();
21623 for v in &mut __struct.id_or_mac {
21624 let val = buf.get_u8();
21625 *v = val;
21626 }
21627 __struct.single_message_size = buf.get_u8();
21628 __struct.msg_pack_size = buf.get_u8();
21629 for v in &mut __struct.messages {
21630 let val = buf.get_u8();
21631 *v = val;
21632 }
21633 Ok(__struct)
21634 }
21635 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21636 let mut __tmp = BytesMut::new(bytes);
21637 #[allow(clippy::absurd_extreme_comparisons)]
21638 #[allow(unused_comparisons)]
21639 if __tmp.remaining() < Self::ENCODED_LEN {
21640 panic!(
21641 "buffer is too small (need {} bytes, but got {})",
21642 Self::ENCODED_LEN,
21643 __tmp.remaining(),
21644 )
21645 }
21646 __tmp.put_u8(self.target_system);
21647 __tmp.put_u8(self.target_component);
21648 for val in &self.id_or_mac {
21649 __tmp.put_u8(*val);
21650 }
21651 __tmp.put_u8(self.single_message_size);
21652 __tmp.put_u8(self.msg_pack_size);
21653 for val in &self.messages {
21654 __tmp.put_u8(*val);
21655 }
21656 if matches!(version, MavlinkVersion::V2) {
21657 let len = __tmp.len();
21658 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21659 } else {
21660 __tmp.len()
21661 }
21662 }
21663}
21664#[doc = "id: 12905"]
21665#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21666#[derive(Debug, Clone, PartialEq)]
21667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21668#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21669pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21670 #[doc = "System ID (0 for broadcast)."]
21671 pub target_system: u8,
21672 #[doc = "Component ID (0 for broadcast)."]
21673 pub target_component: u8,
21674 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21675 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21676 pub id_or_mac: [u8; 20],
21677 #[doc = "Indicates the type of the operator_id field."]
21678 pub operator_id_type: MavOdidOperatorIdType,
21679 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21680 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21681 pub operator_id: [u8; 20],
21682}
21683impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21684 pub const ENCODED_LEN: usize = 43usize;
21685 pub const DEFAULT: Self = Self {
21686 target_system: 0_u8,
21687 target_component: 0_u8,
21688 id_or_mac: [0_u8; 20usize],
21689 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21690 operator_id: [0_u8; 20usize],
21691 };
21692 #[cfg(feature = "arbitrary")]
21693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21694 use arbitrary::{Arbitrary, Unstructured};
21695 let mut buf = [0u8; 1024];
21696 rng.fill_bytes(&mut buf);
21697 let mut unstructured = Unstructured::new(&buf);
21698 Self::arbitrary(&mut unstructured).unwrap_or_default()
21699 }
21700}
21701impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21702 fn default() -> Self {
21703 Self::DEFAULT.clone()
21704 }
21705}
21706impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21707 type Message = MavMessage;
21708 const ID: u32 = 12905u32;
21709 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
21710 const EXTRA_CRC: u8 = 49u8;
21711 const ENCODED_LEN: usize = 43usize;
21712 fn deser(
21713 _version: MavlinkVersion,
21714 __input: &[u8],
21715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21716 let avail_len = __input.len();
21717 let mut payload_buf = [0; Self::ENCODED_LEN];
21718 let mut buf = if avail_len < Self::ENCODED_LEN {
21719 payload_buf[0..avail_len].copy_from_slice(__input);
21720 Bytes::new(&payload_buf)
21721 } else {
21722 Bytes::new(__input)
21723 };
21724 let mut __struct = Self::default();
21725 __struct.target_system = buf.get_u8();
21726 __struct.target_component = buf.get_u8();
21727 for v in &mut __struct.id_or_mac {
21728 let val = buf.get_u8();
21729 *v = val;
21730 }
21731 let tmp = buf.get_u8();
21732 __struct.operator_id_type =
21733 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21734 enum_type: "MavOdidOperatorIdType",
21735 value: tmp as u32,
21736 })?;
21737 for v in &mut __struct.operator_id {
21738 let val = buf.get_u8();
21739 *v = val;
21740 }
21741 Ok(__struct)
21742 }
21743 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21744 let mut __tmp = BytesMut::new(bytes);
21745 #[allow(clippy::absurd_extreme_comparisons)]
21746 #[allow(unused_comparisons)]
21747 if __tmp.remaining() < Self::ENCODED_LEN {
21748 panic!(
21749 "buffer is too small (need {} bytes, but got {})",
21750 Self::ENCODED_LEN,
21751 __tmp.remaining(),
21752 )
21753 }
21754 __tmp.put_u8(self.target_system);
21755 __tmp.put_u8(self.target_component);
21756 for val in &self.id_or_mac {
21757 __tmp.put_u8(*val);
21758 }
21759 __tmp.put_u8(self.operator_id_type as u8);
21760 for val in &self.operator_id {
21761 __tmp.put_u8(*val);
21762 }
21763 if matches!(version, MavlinkVersion::V2) {
21764 let len = __tmp.len();
21765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21766 } else {
21767 __tmp.len()
21768 }
21769 }
21770}
21771#[doc = "id: 12903"]
21772#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
21773#[derive(Debug, Clone, PartialEq)]
21774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21776pub struct OPEN_DRONE_ID_SELF_ID_DATA {
21777 #[doc = "System ID (0 for broadcast)."]
21778 pub target_system: u8,
21779 #[doc = "Component ID (0 for broadcast)."]
21780 pub target_component: u8,
21781 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21782 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21783 pub id_or_mac: [u8; 20],
21784 #[doc = "Indicates the type of the description field."]
21785 pub description_type: MavOdidDescType,
21786 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21787 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21788 pub description: [u8; 23],
21789}
21790impl OPEN_DRONE_ID_SELF_ID_DATA {
21791 pub const ENCODED_LEN: usize = 46usize;
21792 pub const DEFAULT: Self = Self {
21793 target_system: 0_u8,
21794 target_component: 0_u8,
21795 id_or_mac: [0_u8; 20usize],
21796 description_type: MavOdidDescType::DEFAULT,
21797 description: [0_u8; 23usize],
21798 };
21799 #[cfg(feature = "arbitrary")]
21800 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21801 use arbitrary::{Arbitrary, Unstructured};
21802 let mut buf = [0u8; 1024];
21803 rng.fill_bytes(&mut buf);
21804 let mut unstructured = Unstructured::new(&buf);
21805 Self::arbitrary(&mut unstructured).unwrap_or_default()
21806 }
21807}
21808impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
21809 fn default() -> Self {
21810 Self::DEFAULT.clone()
21811 }
21812}
21813impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
21814 type Message = MavMessage;
21815 const ID: u32 = 12903u32;
21816 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
21817 const EXTRA_CRC: u8 = 249u8;
21818 const ENCODED_LEN: usize = 46usize;
21819 fn deser(
21820 _version: MavlinkVersion,
21821 __input: &[u8],
21822 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21823 let avail_len = __input.len();
21824 let mut payload_buf = [0; Self::ENCODED_LEN];
21825 let mut buf = if avail_len < Self::ENCODED_LEN {
21826 payload_buf[0..avail_len].copy_from_slice(__input);
21827 Bytes::new(&payload_buf)
21828 } else {
21829 Bytes::new(__input)
21830 };
21831 let mut __struct = Self::default();
21832 __struct.target_system = buf.get_u8();
21833 __struct.target_component = buf.get_u8();
21834 for v in &mut __struct.id_or_mac {
21835 let val = buf.get_u8();
21836 *v = val;
21837 }
21838 let tmp = buf.get_u8();
21839 __struct.description_type =
21840 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21841 enum_type: "MavOdidDescType",
21842 value: tmp as u32,
21843 })?;
21844 for v in &mut __struct.description {
21845 let val = buf.get_u8();
21846 *v = val;
21847 }
21848 Ok(__struct)
21849 }
21850 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21851 let mut __tmp = BytesMut::new(bytes);
21852 #[allow(clippy::absurd_extreme_comparisons)]
21853 #[allow(unused_comparisons)]
21854 if __tmp.remaining() < Self::ENCODED_LEN {
21855 panic!(
21856 "buffer is too small (need {} bytes, but got {})",
21857 Self::ENCODED_LEN,
21858 __tmp.remaining(),
21859 )
21860 }
21861 __tmp.put_u8(self.target_system);
21862 __tmp.put_u8(self.target_component);
21863 for val in &self.id_or_mac {
21864 __tmp.put_u8(*val);
21865 }
21866 __tmp.put_u8(self.description_type as u8);
21867 for val in &self.description {
21868 __tmp.put_u8(*val);
21869 }
21870 if matches!(version, MavlinkVersion::V2) {
21871 let len = __tmp.len();
21872 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21873 } else {
21874 __tmp.len()
21875 }
21876 }
21877}
21878#[doc = "id: 12904"]
21879#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
21880#[derive(Debug, Clone, PartialEq)]
21881#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21883pub struct OPEN_DRONE_ID_SYSTEM_DATA {
21884 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21885 pub operator_latitude: i32,
21886 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21887 pub operator_longitude: i32,
21888 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21889 pub area_ceiling: f32,
21890 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21891 pub area_floor: f32,
21892 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21893 pub operator_altitude_geo: f32,
21894 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21895 pub timestamp: u32,
21896 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
21897 pub area_count: u16,
21898 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
21899 pub area_radius: u16,
21900 #[doc = "System ID (0 for broadcast)."]
21901 pub target_system: u8,
21902 #[doc = "Component ID (0 for broadcast)."]
21903 pub target_component: u8,
21904 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21905 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21906 pub id_or_mac: [u8; 20],
21907 #[doc = "Specifies the operator location type."]
21908 pub operator_location_type: MavOdidOperatorLocationType,
21909 #[doc = "Specifies the classification type of the UA."]
21910 pub classification_type: MavOdidClassificationType,
21911 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
21912 pub category_eu: MavOdidCategoryEu,
21913 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
21914 pub class_eu: MavOdidClassEu,
21915}
21916impl OPEN_DRONE_ID_SYSTEM_DATA {
21917 pub const ENCODED_LEN: usize = 54usize;
21918 pub const DEFAULT: Self = Self {
21919 operator_latitude: 0_i32,
21920 operator_longitude: 0_i32,
21921 area_ceiling: 0.0_f32,
21922 area_floor: 0.0_f32,
21923 operator_altitude_geo: 0.0_f32,
21924 timestamp: 0_u32,
21925 area_count: 0_u16,
21926 area_radius: 0_u16,
21927 target_system: 0_u8,
21928 target_component: 0_u8,
21929 id_or_mac: [0_u8; 20usize],
21930 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
21931 classification_type: MavOdidClassificationType::DEFAULT,
21932 category_eu: MavOdidCategoryEu::DEFAULT,
21933 class_eu: MavOdidClassEu::DEFAULT,
21934 };
21935 #[cfg(feature = "arbitrary")]
21936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21937 use arbitrary::{Arbitrary, Unstructured};
21938 let mut buf = [0u8; 1024];
21939 rng.fill_bytes(&mut buf);
21940 let mut unstructured = Unstructured::new(&buf);
21941 Self::arbitrary(&mut unstructured).unwrap_or_default()
21942 }
21943}
21944impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
21945 fn default() -> Self {
21946 Self::DEFAULT.clone()
21947 }
21948}
21949impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
21950 type Message = MavMessage;
21951 const ID: u32 = 12904u32;
21952 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
21953 const EXTRA_CRC: u8 = 77u8;
21954 const ENCODED_LEN: usize = 54usize;
21955 fn deser(
21956 _version: MavlinkVersion,
21957 __input: &[u8],
21958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21959 let avail_len = __input.len();
21960 let mut payload_buf = [0; Self::ENCODED_LEN];
21961 let mut buf = if avail_len < Self::ENCODED_LEN {
21962 payload_buf[0..avail_len].copy_from_slice(__input);
21963 Bytes::new(&payload_buf)
21964 } else {
21965 Bytes::new(__input)
21966 };
21967 let mut __struct = Self::default();
21968 __struct.operator_latitude = buf.get_i32_le();
21969 __struct.operator_longitude = buf.get_i32_le();
21970 __struct.area_ceiling = buf.get_f32_le();
21971 __struct.area_floor = buf.get_f32_le();
21972 __struct.operator_altitude_geo = buf.get_f32_le();
21973 __struct.timestamp = buf.get_u32_le();
21974 __struct.area_count = buf.get_u16_le();
21975 __struct.area_radius = buf.get_u16_le();
21976 __struct.target_system = buf.get_u8();
21977 __struct.target_component = buf.get_u8();
21978 for v in &mut __struct.id_or_mac {
21979 let val = buf.get_u8();
21980 *v = val;
21981 }
21982 let tmp = buf.get_u8();
21983 __struct.operator_location_type =
21984 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21985 enum_type: "MavOdidOperatorLocationType",
21986 value: tmp as u32,
21987 })?;
21988 let tmp = buf.get_u8();
21989 __struct.classification_type =
21990 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21991 enum_type: "MavOdidClassificationType",
21992 value: tmp as u32,
21993 })?;
21994 let tmp = buf.get_u8();
21995 __struct.category_eu =
21996 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21997 enum_type: "MavOdidCategoryEu",
21998 value: tmp as u32,
21999 })?;
22000 let tmp = buf.get_u8();
22001 __struct.class_eu =
22002 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22003 enum_type: "MavOdidClassEu",
22004 value: tmp as u32,
22005 })?;
22006 Ok(__struct)
22007 }
22008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22009 let mut __tmp = BytesMut::new(bytes);
22010 #[allow(clippy::absurd_extreme_comparisons)]
22011 #[allow(unused_comparisons)]
22012 if __tmp.remaining() < Self::ENCODED_LEN {
22013 panic!(
22014 "buffer is too small (need {} bytes, but got {})",
22015 Self::ENCODED_LEN,
22016 __tmp.remaining(),
22017 )
22018 }
22019 __tmp.put_i32_le(self.operator_latitude);
22020 __tmp.put_i32_le(self.operator_longitude);
22021 __tmp.put_f32_le(self.area_ceiling);
22022 __tmp.put_f32_le(self.area_floor);
22023 __tmp.put_f32_le(self.operator_altitude_geo);
22024 __tmp.put_u32_le(self.timestamp);
22025 __tmp.put_u16_le(self.area_count);
22026 __tmp.put_u16_le(self.area_radius);
22027 __tmp.put_u8(self.target_system);
22028 __tmp.put_u8(self.target_component);
22029 for val in &self.id_or_mac {
22030 __tmp.put_u8(*val);
22031 }
22032 __tmp.put_u8(self.operator_location_type as u8);
22033 __tmp.put_u8(self.classification_type as u8);
22034 __tmp.put_u8(self.category_eu as u8);
22035 __tmp.put_u8(self.class_eu as u8);
22036 if matches!(version, MavlinkVersion::V2) {
22037 let len = __tmp.len();
22038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22039 } else {
22040 __tmp.len()
22041 }
22042 }
22043}
22044#[doc = "id: 12919"]
22045#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22046#[derive(Debug, Clone, PartialEq)]
22047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22049pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22050 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22051 pub operator_latitude: i32,
22052 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22053 pub operator_longitude: i32,
22054 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22055 pub operator_altitude_geo: f32,
22056 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22057 pub timestamp: u32,
22058 #[doc = "System ID (0 for broadcast)."]
22059 pub target_system: u8,
22060 #[doc = "Component ID (0 for broadcast)."]
22061 pub target_component: u8,
22062}
22063impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22064 pub const ENCODED_LEN: usize = 18usize;
22065 pub const DEFAULT: Self = Self {
22066 operator_latitude: 0_i32,
22067 operator_longitude: 0_i32,
22068 operator_altitude_geo: 0.0_f32,
22069 timestamp: 0_u32,
22070 target_system: 0_u8,
22071 target_component: 0_u8,
22072 };
22073 #[cfg(feature = "arbitrary")]
22074 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22075 use arbitrary::{Arbitrary, Unstructured};
22076 let mut buf = [0u8; 1024];
22077 rng.fill_bytes(&mut buf);
22078 let mut unstructured = Unstructured::new(&buf);
22079 Self::arbitrary(&mut unstructured).unwrap_or_default()
22080 }
22081}
22082impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22083 fn default() -> Self {
22084 Self::DEFAULT.clone()
22085 }
22086}
22087impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22088 type Message = MavMessage;
22089 const ID: u32 = 12919u32;
22090 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22091 const EXTRA_CRC: u8 = 7u8;
22092 const ENCODED_LEN: usize = 18usize;
22093 fn deser(
22094 _version: MavlinkVersion,
22095 __input: &[u8],
22096 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22097 let avail_len = __input.len();
22098 let mut payload_buf = [0; Self::ENCODED_LEN];
22099 let mut buf = if avail_len < Self::ENCODED_LEN {
22100 payload_buf[0..avail_len].copy_from_slice(__input);
22101 Bytes::new(&payload_buf)
22102 } else {
22103 Bytes::new(__input)
22104 };
22105 let mut __struct = Self::default();
22106 __struct.operator_latitude = buf.get_i32_le();
22107 __struct.operator_longitude = buf.get_i32_le();
22108 __struct.operator_altitude_geo = buf.get_f32_le();
22109 __struct.timestamp = buf.get_u32_le();
22110 __struct.target_system = buf.get_u8();
22111 __struct.target_component = buf.get_u8();
22112 Ok(__struct)
22113 }
22114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22115 let mut __tmp = BytesMut::new(bytes);
22116 #[allow(clippy::absurd_extreme_comparisons)]
22117 #[allow(unused_comparisons)]
22118 if __tmp.remaining() < Self::ENCODED_LEN {
22119 panic!(
22120 "buffer is too small (need {} bytes, but got {})",
22121 Self::ENCODED_LEN,
22122 __tmp.remaining(),
22123 )
22124 }
22125 __tmp.put_i32_le(self.operator_latitude);
22126 __tmp.put_i32_le(self.operator_longitude);
22127 __tmp.put_f32_le(self.operator_altitude_geo);
22128 __tmp.put_u32_le(self.timestamp);
22129 __tmp.put_u8(self.target_system);
22130 __tmp.put_u8(self.target_component);
22131 if matches!(version, MavlinkVersion::V2) {
22132 let len = __tmp.len();
22133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22134 } else {
22135 __tmp.len()
22136 }
22137 }
22138}
22139#[doc = "id: 100"]
22140#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22141#[derive(Debug, Clone, PartialEq)]
22142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22144pub struct OPTICAL_FLOW_DATA {
22145 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22146 pub time_usec: u64,
22147 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22148 pub flow_comp_m_x: f32,
22149 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22150 pub flow_comp_m_y: f32,
22151 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22152 pub ground_distance: f32,
22153 #[doc = "Flow in x-sensor direction"]
22154 pub flow_x: i16,
22155 #[doc = "Flow in y-sensor direction"]
22156 pub flow_y: i16,
22157 #[doc = "Sensor ID"]
22158 pub sensor_id: u8,
22159 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22160 pub quality: u8,
22161 #[doc = "Flow rate about X axis"]
22162 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22163 pub flow_rate_x: f32,
22164 #[doc = "Flow rate about Y axis"]
22165 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22166 pub flow_rate_y: f32,
22167}
22168impl OPTICAL_FLOW_DATA {
22169 pub const ENCODED_LEN: usize = 34usize;
22170 pub const DEFAULT: Self = Self {
22171 time_usec: 0_u64,
22172 flow_comp_m_x: 0.0_f32,
22173 flow_comp_m_y: 0.0_f32,
22174 ground_distance: 0.0_f32,
22175 flow_x: 0_i16,
22176 flow_y: 0_i16,
22177 sensor_id: 0_u8,
22178 quality: 0_u8,
22179 flow_rate_x: 0.0_f32,
22180 flow_rate_y: 0.0_f32,
22181 };
22182 #[cfg(feature = "arbitrary")]
22183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22184 use arbitrary::{Arbitrary, Unstructured};
22185 let mut buf = [0u8; 1024];
22186 rng.fill_bytes(&mut buf);
22187 let mut unstructured = Unstructured::new(&buf);
22188 Self::arbitrary(&mut unstructured).unwrap_or_default()
22189 }
22190}
22191impl Default for OPTICAL_FLOW_DATA {
22192 fn default() -> Self {
22193 Self::DEFAULT.clone()
22194 }
22195}
22196impl MessageData for OPTICAL_FLOW_DATA {
22197 type Message = MavMessage;
22198 const ID: u32 = 100u32;
22199 const NAME: &'static str = "OPTICAL_FLOW";
22200 const EXTRA_CRC: u8 = 175u8;
22201 const ENCODED_LEN: usize = 34usize;
22202 fn deser(
22203 _version: MavlinkVersion,
22204 __input: &[u8],
22205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22206 let avail_len = __input.len();
22207 let mut payload_buf = [0; Self::ENCODED_LEN];
22208 let mut buf = if avail_len < Self::ENCODED_LEN {
22209 payload_buf[0..avail_len].copy_from_slice(__input);
22210 Bytes::new(&payload_buf)
22211 } else {
22212 Bytes::new(__input)
22213 };
22214 let mut __struct = Self::default();
22215 __struct.time_usec = buf.get_u64_le();
22216 __struct.flow_comp_m_x = buf.get_f32_le();
22217 __struct.flow_comp_m_y = buf.get_f32_le();
22218 __struct.ground_distance = buf.get_f32_le();
22219 __struct.flow_x = buf.get_i16_le();
22220 __struct.flow_y = buf.get_i16_le();
22221 __struct.sensor_id = buf.get_u8();
22222 __struct.quality = buf.get_u8();
22223 __struct.flow_rate_x = buf.get_f32_le();
22224 __struct.flow_rate_y = buf.get_f32_le();
22225 Ok(__struct)
22226 }
22227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22228 let mut __tmp = BytesMut::new(bytes);
22229 #[allow(clippy::absurd_extreme_comparisons)]
22230 #[allow(unused_comparisons)]
22231 if __tmp.remaining() < Self::ENCODED_LEN {
22232 panic!(
22233 "buffer is too small (need {} bytes, but got {})",
22234 Self::ENCODED_LEN,
22235 __tmp.remaining(),
22236 )
22237 }
22238 __tmp.put_u64_le(self.time_usec);
22239 __tmp.put_f32_le(self.flow_comp_m_x);
22240 __tmp.put_f32_le(self.flow_comp_m_y);
22241 __tmp.put_f32_le(self.ground_distance);
22242 __tmp.put_i16_le(self.flow_x);
22243 __tmp.put_i16_le(self.flow_y);
22244 __tmp.put_u8(self.sensor_id);
22245 __tmp.put_u8(self.quality);
22246 __tmp.put_f32_le(self.flow_rate_x);
22247 __tmp.put_f32_le(self.flow_rate_y);
22248 if matches!(version, MavlinkVersion::V2) {
22249 let len = __tmp.len();
22250 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22251 } else {
22252 __tmp.len()
22253 }
22254 }
22255}
22256#[doc = "id: 106"]
22257#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22258#[derive(Debug, Clone, PartialEq)]
22259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22261pub struct OPTICAL_FLOW_RAD_DATA {
22262 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22263 pub time_usec: u64,
22264 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22265 pub integration_time_us: u32,
22266 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22267 pub integrated_x: f32,
22268 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22269 pub integrated_y: f32,
22270 #[doc = "RH rotation around X axis"]
22271 pub integrated_xgyro: f32,
22272 #[doc = "RH rotation around Y axis"]
22273 pub integrated_ygyro: f32,
22274 #[doc = "RH rotation around Z axis"]
22275 pub integrated_zgyro: f32,
22276 #[doc = "Time since the distance was sampled."]
22277 pub time_delta_distance_us: u32,
22278 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22279 pub distance: f32,
22280 #[doc = "Temperature"]
22281 pub temperature: i16,
22282 #[doc = "Sensor ID"]
22283 pub sensor_id: u8,
22284 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22285 pub quality: u8,
22286}
22287impl OPTICAL_FLOW_RAD_DATA {
22288 pub const ENCODED_LEN: usize = 44usize;
22289 pub const DEFAULT: Self = Self {
22290 time_usec: 0_u64,
22291 integration_time_us: 0_u32,
22292 integrated_x: 0.0_f32,
22293 integrated_y: 0.0_f32,
22294 integrated_xgyro: 0.0_f32,
22295 integrated_ygyro: 0.0_f32,
22296 integrated_zgyro: 0.0_f32,
22297 time_delta_distance_us: 0_u32,
22298 distance: 0.0_f32,
22299 temperature: 0_i16,
22300 sensor_id: 0_u8,
22301 quality: 0_u8,
22302 };
22303 #[cfg(feature = "arbitrary")]
22304 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22305 use arbitrary::{Arbitrary, Unstructured};
22306 let mut buf = [0u8; 1024];
22307 rng.fill_bytes(&mut buf);
22308 let mut unstructured = Unstructured::new(&buf);
22309 Self::arbitrary(&mut unstructured).unwrap_or_default()
22310 }
22311}
22312impl Default for OPTICAL_FLOW_RAD_DATA {
22313 fn default() -> Self {
22314 Self::DEFAULT.clone()
22315 }
22316}
22317impl MessageData for OPTICAL_FLOW_RAD_DATA {
22318 type Message = MavMessage;
22319 const ID: u32 = 106u32;
22320 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22321 const EXTRA_CRC: u8 = 138u8;
22322 const ENCODED_LEN: usize = 44usize;
22323 fn deser(
22324 _version: MavlinkVersion,
22325 __input: &[u8],
22326 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22327 let avail_len = __input.len();
22328 let mut payload_buf = [0; Self::ENCODED_LEN];
22329 let mut buf = if avail_len < Self::ENCODED_LEN {
22330 payload_buf[0..avail_len].copy_from_slice(__input);
22331 Bytes::new(&payload_buf)
22332 } else {
22333 Bytes::new(__input)
22334 };
22335 let mut __struct = Self::default();
22336 __struct.time_usec = buf.get_u64_le();
22337 __struct.integration_time_us = buf.get_u32_le();
22338 __struct.integrated_x = buf.get_f32_le();
22339 __struct.integrated_y = buf.get_f32_le();
22340 __struct.integrated_xgyro = buf.get_f32_le();
22341 __struct.integrated_ygyro = buf.get_f32_le();
22342 __struct.integrated_zgyro = buf.get_f32_le();
22343 __struct.time_delta_distance_us = buf.get_u32_le();
22344 __struct.distance = buf.get_f32_le();
22345 __struct.temperature = buf.get_i16_le();
22346 __struct.sensor_id = buf.get_u8();
22347 __struct.quality = buf.get_u8();
22348 Ok(__struct)
22349 }
22350 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22351 let mut __tmp = BytesMut::new(bytes);
22352 #[allow(clippy::absurd_extreme_comparisons)]
22353 #[allow(unused_comparisons)]
22354 if __tmp.remaining() < Self::ENCODED_LEN {
22355 panic!(
22356 "buffer is too small (need {} bytes, but got {})",
22357 Self::ENCODED_LEN,
22358 __tmp.remaining(),
22359 )
22360 }
22361 __tmp.put_u64_le(self.time_usec);
22362 __tmp.put_u32_le(self.integration_time_us);
22363 __tmp.put_f32_le(self.integrated_x);
22364 __tmp.put_f32_le(self.integrated_y);
22365 __tmp.put_f32_le(self.integrated_xgyro);
22366 __tmp.put_f32_le(self.integrated_ygyro);
22367 __tmp.put_f32_le(self.integrated_zgyro);
22368 __tmp.put_u32_le(self.time_delta_distance_us);
22369 __tmp.put_f32_le(self.distance);
22370 __tmp.put_i16_le(self.temperature);
22371 __tmp.put_u8(self.sensor_id);
22372 __tmp.put_u8(self.quality);
22373 if matches!(version, MavlinkVersion::V2) {
22374 let len = __tmp.len();
22375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22376 } else {
22377 __tmp.len()
22378 }
22379 }
22380}
22381#[doc = "id: 360"]
22382#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22383#[derive(Debug, Clone, PartialEq)]
22384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22386pub struct ORBIT_EXECUTION_STATUS_DATA {
22387 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22388 pub time_usec: u64,
22389 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22390 pub radius: f32,
22391 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22392 pub x: i32,
22393 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22394 pub y: i32,
22395 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22396 pub z: f32,
22397 #[doc = "The coordinate system of the fields: x, y, z."]
22398 pub frame: MavFrame,
22399}
22400impl ORBIT_EXECUTION_STATUS_DATA {
22401 pub const ENCODED_LEN: usize = 25usize;
22402 pub const DEFAULT: Self = Self {
22403 time_usec: 0_u64,
22404 radius: 0.0_f32,
22405 x: 0_i32,
22406 y: 0_i32,
22407 z: 0.0_f32,
22408 frame: MavFrame::DEFAULT,
22409 };
22410 #[cfg(feature = "arbitrary")]
22411 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22412 use arbitrary::{Arbitrary, Unstructured};
22413 let mut buf = [0u8; 1024];
22414 rng.fill_bytes(&mut buf);
22415 let mut unstructured = Unstructured::new(&buf);
22416 Self::arbitrary(&mut unstructured).unwrap_or_default()
22417 }
22418}
22419impl Default for ORBIT_EXECUTION_STATUS_DATA {
22420 fn default() -> Self {
22421 Self::DEFAULT.clone()
22422 }
22423}
22424impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22425 type Message = MavMessage;
22426 const ID: u32 = 360u32;
22427 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22428 const EXTRA_CRC: u8 = 11u8;
22429 const ENCODED_LEN: usize = 25usize;
22430 fn deser(
22431 _version: MavlinkVersion,
22432 __input: &[u8],
22433 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22434 let avail_len = __input.len();
22435 let mut payload_buf = [0; Self::ENCODED_LEN];
22436 let mut buf = if avail_len < Self::ENCODED_LEN {
22437 payload_buf[0..avail_len].copy_from_slice(__input);
22438 Bytes::new(&payload_buf)
22439 } else {
22440 Bytes::new(__input)
22441 };
22442 let mut __struct = Self::default();
22443 __struct.time_usec = buf.get_u64_le();
22444 __struct.radius = buf.get_f32_le();
22445 __struct.x = buf.get_i32_le();
22446 __struct.y = buf.get_i32_le();
22447 __struct.z = buf.get_f32_le();
22448 let tmp = buf.get_u8();
22449 __struct.frame =
22450 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22451 enum_type: "MavFrame",
22452 value: tmp as u32,
22453 })?;
22454 Ok(__struct)
22455 }
22456 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22457 let mut __tmp = BytesMut::new(bytes);
22458 #[allow(clippy::absurd_extreme_comparisons)]
22459 #[allow(unused_comparisons)]
22460 if __tmp.remaining() < Self::ENCODED_LEN {
22461 panic!(
22462 "buffer is too small (need {} bytes, but got {})",
22463 Self::ENCODED_LEN,
22464 __tmp.remaining(),
22465 )
22466 }
22467 __tmp.put_u64_le(self.time_usec);
22468 __tmp.put_f32_le(self.radius);
22469 __tmp.put_i32_le(self.x);
22470 __tmp.put_i32_le(self.y);
22471 __tmp.put_f32_le(self.z);
22472 __tmp.put_u8(self.frame as u8);
22473 if matches!(version, MavlinkVersion::V2) {
22474 let len = __tmp.len();
22475 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22476 } else {
22477 __tmp.len()
22478 }
22479 }
22480}
22481#[doc = "id: 324"]
22482#[doc = "Response from a PARAM_EXT_SET message."]
22483#[derive(Debug, Clone, PartialEq)]
22484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22486pub struct PARAM_EXT_ACK_DATA {
22487 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22489 pub param_id: [u8; 16],
22490 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22491 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22492 pub param_value: [u8; 128],
22493 #[doc = "Parameter type."]
22494 pub param_type: MavParamExtType,
22495 #[doc = "Result code."]
22496 pub param_result: ParamAck,
22497}
22498impl PARAM_EXT_ACK_DATA {
22499 pub const ENCODED_LEN: usize = 146usize;
22500 pub const DEFAULT: Self = Self {
22501 param_id: [0_u8; 16usize],
22502 param_value: [0_u8; 128usize],
22503 param_type: MavParamExtType::DEFAULT,
22504 param_result: ParamAck::DEFAULT,
22505 };
22506 #[cfg(feature = "arbitrary")]
22507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22508 use arbitrary::{Arbitrary, Unstructured};
22509 let mut buf = [0u8; 1024];
22510 rng.fill_bytes(&mut buf);
22511 let mut unstructured = Unstructured::new(&buf);
22512 Self::arbitrary(&mut unstructured).unwrap_or_default()
22513 }
22514}
22515impl Default for PARAM_EXT_ACK_DATA {
22516 fn default() -> Self {
22517 Self::DEFAULT.clone()
22518 }
22519}
22520impl MessageData for PARAM_EXT_ACK_DATA {
22521 type Message = MavMessage;
22522 const ID: u32 = 324u32;
22523 const NAME: &'static str = "PARAM_EXT_ACK";
22524 const EXTRA_CRC: u8 = 132u8;
22525 const ENCODED_LEN: usize = 146usize;
22526 fn deser(
22527 _version: MavlinkVersion,
22528 __input: &[u8],
22529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22530 let avail_len = __input.len();
22531 let mut payload_buf = [0; Self::ENCODED_LEN];
22532 let mut buf = if avail_len < Self::ENCODED_LEN {
22533 payload_buf[0..avail_len].copy_from_slice(__input);
22534 Bytes::new(&payload_buf)
22535 } else {
22536 Bytes::new(__input)
22537 };
22538 let mut __struct = Self::default();
22539 for v in &mut __struct.param_id {
22540 let val = buf.get_u8();
22541 *v = val;
22542 }
22543 for v in &mut __struct.param_value {
22544 let val = buf.get_u8();
22545 *v = val;
22546 }
22547 let tmp = buf.get_u8();
22548 __struct.param_type =
22549 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22550 enum_type: "MavParamExtType",
22551 value: tmp as u32,
22552 })?;
22553 let tmp = buf.get_u8();
22554 __struct.param_result =
22555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22556 enum_type: "ParamAck",
22557 value: tmp as u32,
22558 })?;
22559 Ok(__struct)
22560 }
22561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22562 let mut __tmp = BytesMut::new(bytes);
22563 #[allow(clippy::absurd_extreme_comparisons)]
22564 #[allow(unused_comparisons)]
22565 if __tmp.remaining() < Self::ENCODED_LEN {
22566 panic!(
22567 "buffer is too small (need {} bytes, but got {})",
22568 Self::ENCODED_LEN,
22569 __tmp.remaining(),
22570 )
22571 }
22572 for val in &self.param_id {
22573 __tmp.put_u8(*val);
22574 }
22575 for val in &self.param_value {
22576 __tmp.put_u8(*val);
22577 }
22578 __tmp.put_u8(self.param_type as u8);
22579 __tmp.put_u8(self.param_result as u8);
22580 if matches!(version, MavlinkVersion::V2) {
22581 let len = __tmp.len();
22582 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22583 } else {
22584 __tmp.len()
22585 }
22586 }
22587}
22588#[doc = "id: 321"]
22589#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22590#[derive(Debug, Clone, PartialEq)]
22591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22593pub struct PARAM_EXT_REQUEST_LIST_DATA {
22594 #[doc = "System ID"]
22595 pub target_system: u8,
22596 #[doc = "Component ID"]
22597 pub target_component: u8,
22598}
22599impl PARAM_EXT_REQUEST_LIST_DATA {
22600 pub const ENCODED_LEN: usize = 2usize;
22601 pub const DEFAULT: Self = Self {
22602 target_system: 0_u8,
22603 target_component: 0_u8,
22604 };
22605 #[cfg(feature = "arbitrary")]
22606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22607 use arbitrary::{Arbitrary, Unstructured};
22608 let mut buf = [0u8; 1024];
22609 rng.fill_bytes(&mut buf);
22610 let mut unstructured = Unstructured::new(&buf);
22611 Self::arbitrary(&mut unstructured).unwrap_or_default()
22612 }
22613}
22614impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22615 fn default() -> Self {
22616 Self::DEFAULT.clone()
22617 }
22618}
22619impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22620 type Message = MavMessage;
22621 const ID: u32 = 321u32;
22622 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22623 const EXTRA_CRC: u8 = 88u8;
22624 const ENCODED_LEN: usize = 2usize;
22625 fn deser(
22626 _version: MavlinkVersion,
22627 __input: &[u8],
22628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22629 let avail_len = __input.len();
22630 let mut payload_buf = [0; Self::ENCODED_LEN];
22631 let mut buf = if avail_len < Self::ENCODED_LEN {
22632 payload_buf[0..avail_len].copy_from_slice(__input);
22633 Bytes::new(&payload_buf)
22634 } else {
22635 Bytes::new(__input)
22636 };
22637 let mut __struct = Self::default();
22638 __struct.target_system = buf.get_u8();
22639 __struct.target_component = buf.get_u8();
22640 Ok(__struct)
22641 }
22642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22643 let mut __tmp = BytesMut::new(bytes);
22644 #[allow(clippy::absurd_extreme_comparisons)]
22645 #[allow(unused_comparisons)]
22646 if __tmp.remaining() < Self::ENCODED_LEN {
22647 panic!(
22648 "buffer is too small (need {} bytes, but got {})",
22649 Self::ENCODED_LEN,
22650 __tmp.remaining(),
22651 )
22652 }
22653 __tmp.put_u8(self.target_system);
22654 __tmp.put_u8(self.target_component);
22655 if matches!(version, MavlinkVersion::V2) {
22656 let len = __tmp.len();
22657 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22658 } else {
22659 __tmp.len()
22660 }
22661 }
22662}
22663#[doc = "id: 320"]
22664#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22665#[derive(Debug, Clone, PartialEq)]
22666#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22667#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22668pub struct PARAM_EXT_REQUEST_READ_DATA {
22669 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22670 pub param_index: i16,
22671 #[doc = "System ID"]
22672 pub target_system: u8,
22673 #[doc = "Component ID"]
22674 pub target_component: u8,
22675 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22676 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22677 pub param_id: [u8; 16],
22678}
22679impl PARAM_EXT_REQUEST_READ_DATA {
22680 pub const ENCODED_LEN: usize = 20usize;
22681 pub const DEFAULT: Self = Self {
22682 param_index: 0_i16,
22683 target_system: 0_u8,
22684 target_component: 0_u8,
22685 param_id: [0_u8; 16usize],
22686 };
22687 #[cfg(feature = "arbitrary")]
22688 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22689 use arbitrary::{Arbitrary, Unstructured};
22690 let mut buf = [0u8; 1024];
22691 rng.fill_bytes(&mut buf);
22692 let mut unstructured = Unstructured::new(&buf);
22693 Self::arbitrary(&mut unstructured).unwrap_or_default()
22694 }
22695}
22696impl Default for PARAM_EXT_REQUEST_READ_DATA {
22697 fn default() -> Self {
22698 Self::DEFAULT.clone()
22699 }
22700}
22701impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
22702 type Message = MavMessage;
22703 const ID: u32 = 320u32;
22704 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
22705 const EXTRA_CRC: u8 = 243u8;
22706 const ENCODED_LEN: usize = 20usize;
22707 fn deser(
22708 _version: MavlinkVersion,
22709 __input: &[u8],
22710 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22711 let avail_len = __input.len();
22712 let mut payload_buf = [0; Self::ENCODED_LEN];
22713 let mut buf = if avail_len < Self::ENCODED_LEN {
22714 payload_buf[0..avail_len].copy_from_slice(__input);
22715 Bytes::new(&payload_buf)
22716 } else {
22717 Bytes::new(__input)
22718 };
22719 let mut __struct = Self::default();
22720 __struct.param_index = buf.get_i16_le();
22721 __struct.target_system = buf.get_u8();
22722 __struct.target_component = buf.get_u8();
22723 for v in &mut __struct.param_id {
22724 let val = buf.get_u8();
22725 *v = val;
22726 }
22727 Ok(__struct)
22728 }
22729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22730 let mut __tmp = BytesMut::new(bytes);
22731 #[allow(clippy::absurd_extreme_comparisons)]
22732 #[allow(unused_comparisons)]
22733 if __tmp.remaining() < Self::ENCODED_LEN {
22734 panic!(
22735 "buffer is too small (need {} bytes, but got {})",
22736 Self::ENCODED_LEN,
22737 __tmp.remaining(),
22738 )
22739 }
22740 __tmp.put_i16_le(self.param_index);
22741 __tmp.put_u8(self.target_system);
22742 __tmp.put_u8(self.target_component);
22743 for val in &self.param_id {
22744 __tmp.put_u8(*val);
22745 }
22746 if matches!(version, MavlinkVersion::V2) {
22747 let len = __tmp.len();
22748 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22749 } else {
22750 __tmp.len()
22751 }
22752 }
22753}
22754#[doc = "id: 323"]
22755#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
22756#[derive(Debug, Clone, PartialEq)]
22757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22759pub struct PARAM_EXT_SET_DATA {
22760 #[doc = "System ID"]
22761 pub target_system: u8,
22762 #[doc = "Component ID"]
22763 pub target_component: u8,
22764 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22765 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22766 pub param_id: [u8; 16],
22767 #[doc = "Parameter value"]
22768 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22769 pub param_value: [u8; 128],
22770 #[doc = "Parameter type."]
22771 pub param_type: MavParamExtType,
22772}
22773impl PARAM_EXT_SET_DATA {
22774 pub const ENCODED_LEN: usize = 147usize;
22775 pub const DEFAULT: Self = Self {
22776 target_system: 0_u8,
22777 target_component: 0_u8,
22778 param_id: [0_u8; 16usize],
22779 param_value: [0_u8; 128usize],
22780 param_type: MavParamExtType::DEFAULT,
22781 };
22782 #[cfg(feature = "arbitrary")]
22783 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22784 use arbitrary::{Arbitrary, Unstructured};
22785 let mut buf = [0u8; 1024];
22786 rng.fill_bytes(&mut buf);
22787 let mut unstructured = Unstructured::new(&buf);
22788 Self::arbitrary(&mut unstructured).unwrap_or_default()
22789 }
22790}
22791impl Default for PARAM_EXT_SET_DATA {
22792 fn default() -> Self {
22793 Self::DEFAULT.clone()
22794 }
22795}
22796impl MessageData for PARAM_EXT_SET_DATA {
22797 type Message = MavMessage;
22798 const ID: u32 = 323u32;
22799 const NAME: &'static str = "PARAM_EXT_SET";
22800 const EXTRA_CRC: u8 = 78u8;
22801 const ENCODED_LEN: usize = 147usize;
22802 fn deser(
22803 _version: MavlinkVersion,
22804 __input: &[u8],
22805 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22806 let avail_len = __input.len();
22807 let mut payload_buf = [0; Self::ENCODED_LEN];
22808 let mut buf = if avail_len < Self::ENCODED_LEN {
22809 payload_buf[0..avail_len].copy_from_slice(__input);
22810 Bytes::new(&payload_buf)
22811 } else {
22812 Bytes::new(__input)
22813 };
22814 let mut __struct = Self::default();
22815 __struct.target_system = buf.get_u8();
22816 __struct.target_component = buf.get_u8();
22817 for v in &mut __struct.param_id {
22818 let val = buf.get_u8();
22819 *v = val;
22820 }
22821 for v in &mut __struct.param_value {
22822 let val = buf.get_u8();
22823 *v = val;
22824 }
22825 let tmp = buf.get_u8();
22826 __struct.param_type =
22827 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22828 enum_type: "MavParamExtType",
22829 value: tmp as u32,
22830 })?;
22831 Ok(__struct)
22832 }
22833 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22834 let mut __tmp = BytesMut::new(bytes);
22835 #[allow(clippy::absurd_extreme_comparisons)]
22836 #[allow(unused_comparisons)]
22837 if __tmp.remaining() < Self::ENCODED_LEN {
22838 panic!(
22839 "buffer is too small (need {} bytes, but got {})",
22840 Self::ENCODED_LEN,
22841 __tmp.remaining(),
22842 )
22843 }
22844 __tmp.put_u8(self.target_system);
22845 __tmp.put_u8(self.target_component);
22846 for val in &self.param_id {
22847 __tmp.put_u8(*val);
22848 }
22849 for val in &self.param_value {
22850 __tmp.put_u8(*val);
22851 }
22852 __tmp.put_u8(self.param_type as u8);
22853 if matches!(version, MavlinkVersion::V2) {
22854 let len = __tmp.len();
22855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22856 } else {
22857 __tmp.len()
22858 }
22859 }
22860}
22861#[doc = "id: 322"]
22862#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
22863#[derive(Debug, Clone, PartialEq)]
22864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22866pub struct PARAM_EXT_VALUE_DATA {
22867 #[doc = "Total number of parameters"]
22868 pub param_count: u16,
22869 #[doc = "Index of this parameter"]
22870 pub param_index: u16,
22871 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22872 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22873 pub param_id: [u8; 16],
22874 #[doc = "Parameter value"]
22875 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22876 pub param_value: [u8; 128],
22877 #[doc = "Parameter type."]
22878 pub param_type: MavParamExtType,
22879}
22880impl PARAM_EXT_VALUE_DATA {
22881 pub const ENCODED_LEN: usize = 149usize;
22882 pub const DEFAULT: Self = Self {
22883 param_count: 0_u16,
22884 param_index: 0_u16,
22885 param_id: [0_u8; 16usize],
22886 param_value: [0_u8; 128usize],
22887 param_type: MavParamExtType::DEFAULT,
22888 };
22889 #[cfg(feature = "arbitrary")]
22890 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22891 use arbitrary::{Arbitrary, Unstructured};
22892 let mut buf = [0u8; 1024];
22893 rng.fill_bytes(&mut buf);
22894 let mut unstructured = Unstructured::new(&buf);
22895 Self::arbitrary(&mut unstructured).unwrap_or_default()
22896 }
22897}
22898impl Default for PARAM_EXT_VALUE_DATA {
22899 fn default() -> Self {
22900 Self::DEFAULT.clone()
22901 }
22902}
22903impl MessageData for PARAM_EXT_VALUE_DATA {
22904 type Message = MavMessage;
22905 const ID: u32 = 322u32;
22906 const NAME: &'static str = "PARAM_EXT_VALUE";
22907 const EXTRA_CRC: u8 = 243u8;
22908 const ENCODED_LEN: usize = 149usize;
22909 fn deser(
22910 _version: MavlinkVersion,
22911 __input: &[u8],
22912 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22913 let avail_len = __input.len();
22914 let mut payload_buf = [0; Self::ENCODED_LEN];
22915 let mut buf = if avail_len < Self::ENCODED_LEN {
22916 payload_buf[0..avail_len].copy_from_slice(__input);
22917 Bytes::new(&payload_buf)
22918 } else {
22919 Bytes::new(__input)
22920 };
22921 let mut __struct = Self::default();
22922 __struct.param_count = buf.get_u16_le();
22923 __struct.param_index = buf.get_u16_le();
22924 for v in &mut __struct.param_id {
22925 let val = buf.get_u8();
22926 *v = val;
22927 }
22928 for v in &mut __struct.param_value {
22929 let val = buf.get_u8();
22930 *v = val;
22931 }
22932 let tmp = buf.get_u8();
22933 __struct.param_type =
22934 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22935 enum_type: "MavParamExtType",
22936 value: tmp as u32,
22937 })?;
22938 Ok(__struct)
22939 }
22940 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22941 let mut __tmp = BytesMut::new(bytes);
22942 #[allow(clippy::absurd_extreme_comparisons)]
22943 #[allow(unused_comparisons)]
22944 if __tmp.remaining() < Self::ENCODED_LEN {
22945 panic!(
22946 "buffer is too small (need {} bytes, but got {})",
22947 Self::ENCODED_LEN,
22948 __tmp.remaining(),
22949 )
22950 }
22951 __tmp.put_u16_le(self.param_count);
22952 __tmp.put_u16_le(self.param_index);
22953 for val in &self.param_id {
22954 __tmp.put_u8(*val);
22955 }
22956 for val in &self.param_value {
22957 __tmp.put_u8(*val);
22958 }
22959 __tmp.put_u8(self.param_type as u8);
22960 if matches!(version, MavlinkVersion::V2) {
22961 let len = __tmp.len();
22962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22963 } else {
22964 __tmp.len()
22965 }
22966 }
22967}
22968#[doc = "id: 50"]
22969#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
22970#[derive(Debug, Clone, PartialEq)]
22971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22973pub struct PARAM_MAP_RC_DATA {
22974 #[doc = "Initial parameter value"]
22975 pub param_value0: f32,
22976 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
22977 pub scale: f32,
22978 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
22979 pub param_value_min: f32,
22980 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
22981 pub param_value_max: f32,
22982 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
22983 pub param_index: i16,
22984 #[doc = "System ID"]
22985 pub target_system: u8,
22986 #[doc = "Component ID"]
22987 pub target_component: u8,
22988 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22989 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22990 pub param_id: [u8; 16],
22991 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
22992 pub parameter_rc_channel_index: u8,
22993}
22994impl PARAM_MAP_RC_DATA {
22995 pub const ENCODED_LEN: usize = 37usize;
22996 pub const DEFAULT: Self = Self {
22997 param_value0: 0.0_f32,
22998 scale: 0.0_f32,
22999 param_value_min: 0.0_f32,
23000 param_value_max: 0.0_f32,
23001 param_index: 0_i16,
23002 target_system: 0_u8,
23003 target_component: 0_u8,
23004 param_id: [0_u8; 16usize],
23005 parameter_rc_channel_index: 0_u8,
23006 };
23007 #[cfg(feature = "arbitrary")]
23008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23009 use arbitrary::{Arbitrary, Unstructured};
23010 let mut buf = [0u8; 1024];
23011 rng.fill_bytes(&mut buf);
23012 let mut unstructured = Unstructured::new(&buf);
23013 Self::arbitrary(&mut unstructured).unwrap_or_default()
23014 }
23015}
23016impl Default for PARAM_MAP_RC_DATA {
23017 fn default() -> Self {
23018 Self::DEFAULT.clone()
23019 }
23020}
23021impl MessageData for PARAM_MAP_RC_DATA {
23022 type Message = MavMessage;
23023 const ID: u32 = 50u32;
23024 const NAME: &'static str = "PARAM_MAP_RC";
23025 const EXTRA_CRC: u8 = 78u8;
23026 const ENCODED_LEN: usize = 37usize;
23027 fn deser(
23028 _version: MavlinkVersion,
23029 __input: &[u8],
23030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23031 let avail_len = __input.len();
23032 let mut payload_buf = [0; Self::ENCODED_LEN];
23033 let mut buf = if avail_len < Self::ENCODED_LEN {
23034 payload_buf[0..avail_len].copy_from_slice(__input);
23035 Bytes::new(&payload_buf)
23036 } else {
23037 Bytes::new(__input)
23038 };
23039 let mut __struct = Self::default();
23040 __struct.param_value0 = buf.get_f32_le();
23041 __struct.scale = buf.get_f32_le();
23042 __struct.param_value_min = buf.get_f32_le();
23043 __struct.param_value_max = buf.get_f32_le();
23044 __struct.param_index = buf.get_i16_le();
23045 __struct.target_system = buf.get_u8();
23046 __struct.target_component = buf.get_u8();
23047 for v in &mut __struct.param_id {
23048 let val = buf.get_u8();
23049 *v = val;
23050 }
23051 __struct.parameter_rc_channel_index = buf.get_u8();
23052 Ok(__struct)
23053 }
23054 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23055 let mut __tmp = BytesMut::new(bytes);
23056 #[allow(clippy::absurd_extreme_comparisons)]
23057 #[allow(unused_comparisons)]
23058 if __tmp.remaining() < Self::ENCODED_LEN {
23059 panic!(
23060 "buffer is too small (need {} bytes, but got {})",
23061 Self::ENCODED_LEN,
23062 __tmp.remaining(),
23063 )
23064 }
23065 __tmp.put_f32_le(self.param_value0);
23066 __tmp.put_f32_le(self.scale);
23067 __tmp.put_f32_le(self.param_value_min);
23068 __tmp.put_f32_le(self.param_value_max);
23069 __tmp.put_i16_le(self.param_index);
23070 __tmp.put_u8(self.target_system);
23071 __tmp.put_u8(self.target_component);
23072 for val in &self.param_id {
23073 __tmp.put_u8(*val);
23074 }
23075 __tmp.put_u8(self.parameter_rc_channel_index);
23076 if matches!(version, MavlinkVersion::V2) {
23077 let len = __tmp.len();
23078 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23079 } else {
23080 __tmp.len()
23081 }
23082 }
23083}
23084#[doc = "id: 21"]
23085#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23086#[derive(Debug, Clone, PartialEq)]
23087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23089pub struct PARAM_REQUEST_LIST_DATA {
23090 #[doc = "System ID"]
23091 pub target_system: u8,
23092 #[doc = "Component ID"]
23093 pub target_component: u8,
23094}
23095impl PARAM_REQUEST_LIST_DATA {
23096 pub const ENCODED_LEN: usize = 2usize;
23097 pub const DEFAULT: Self = Self {
23098 target_system: 0_u8,
23099 target_component: 0_u8,
23100 };
23101 #[cfg(feature = "arbitrary")]
23102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23103 use arbitrary::{Arbitrary, Unstructured};
23104 let mut buf = [0u8; 1024];
23105 rng.fill_bytes(&mut buf);
23106 let mut unstructured = Unstructured::new(&buf);
23107 Self::arbitrary(&mut unstructured).unwrap_or_default()
23108 }
23109}
23110impl Default for PARAM_REQUEST_LIST_DATA {
23111 fn default() -> Self {
23112 Self::DEFAULT.clone()
23113 }
23114}
23115impl MessageData for PARAM_REQUEST_LIST_DATA {
23116 type Message = MavMessage;
23117 const ID: u32 = 21u32;
23118 const NAME: &'static str = "PARAM_REQUEST_LIST";
23119 const EXTRA_CRC: u8 = 159u8;
23120 const ENCODED_LEN: usize = 2usize;
23121 fn deser(
23122 _version: MavlinkVersion,
23123 __input: &[u8],
23124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23125 let avail_len = __input.len();
23126 let mut payload_buf = [0; Self::ENCODED_LEN];
23127 let mut buf = if avail_len < Self::ENCODED_LEN {
23128 payload_buf[0..avail_len].copy_from_slice(__input);
23129 Bytes::new(&payload_buf)
23130 } else {
23131 Bytes::new(__input)
23132 };
23133 let mut __struct = Self::default();
23134 __struct.target_system = buf.get_u8();
23135 __struct.target_component = buf.get_u8();
23136 Ok(__struct)
23137 }
23138 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23139 let mut __tmp = BytesMut::new(bytes);
23140 #[allow(clippy::absurd_extreme_comparisons)]
23141 #[allow(unused_comparisons)]
23142 if __tmp.remaining() < Self::ENCODED_LEN {
23143 panic!(
23144 "buffer is too small (need {} bytes, but got {})",
23145 Self::ENCODED_LEN,
23146 __tmp.remaining(),
23147 )
23148 }
23149 __tmp.put_u8(self.target_system);
23150 __tmp.put_u8(self.target_component);
23151 if matches!(version, MavlinkVersion::V2) {
23152 let len = __tmp.len();
23153 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23154 } else {
23155 __tmp.len()
23156 }
23157 }
23158}
23159#[doc = "id: 20"]
23160#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23161#[derive(Debug, Clone, PartialEq)]
23162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23164pub struct PARAM_REQUEST_READ_DATA {
23165 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23166 pub param_index: i16,
23167 #[doc = "System ID"]
23168 pub target_system: u8,
23169 #[doc = "Component ID"]
23170 pub target_component: u8,
23171 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23172 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23173 pub param_id: [u8; 16],
23174}
23175impl PARAM_REQUEST_READ_DATA {
23176 pub const ENCODED_LEN: usize = 20usize;
23177 pub const DEFAULT: Self = Self {
23178 param_index: 0_i16,
23179 target_system: 0_u8,
23180 target_component: 0_u8,
23181 param_id: [0_u8; 16usize],
23182 };
23183 #[cfg(feature = "arbitrary")]
23184 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23185 use arbitrary::{Arbitrary, Unstructured};
23186 let mut buf = [0u8; 1024];
23187 rng.fill_bytes(&mut buf);
23188 let mut unstructured = Unstructured::new(&buf);
23189 Self::arbitrary(&mut unstructured).unwrap_or_default()
23190 }
23191}
23192impl Default for PARAM_REQUEST_READ_DATA {
23193 fn default() -> Self {
23194 Self::DEFAULT.clone()
23195 }
23196}
23197impl MessageData for PARAM_REQUEST_READ_DATA {
23198 type Message = MavMessage;
23199 const ID: u32 = 20u32;
23200 const NAME: &'static str = "PARAM_REQUEST_READ";
23201 const EXTRA_CRC: u8 = 214u8;
23202 const ENCODED_LEN: usize = 20usize;
23203 fn deser(
23204 _version: MavlinkVersion,
23205 __input: &[u8],
23206 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23207 let avail_len = __input.len();
23208 let mut payload_buf = [0; Self::ENCODED_LEN];
23209 let mut buf = if avail_len < Self::ENCODED_LEN {
23210 payload_buf[0..avail_len].copy_from_slice(__input);
23211 Bytes::new(&payload_buf)
23212 } else {
23213 Bytes::new(__input)
23214 };
23215 let mut __struct = Self::default();
23216 __struct.param_index = buf.get_i16_le();
23217 __struct.target_system = buf.get_u8();
23218 __struct.target_component = buf.get_u8();
23219 for v in &mut __struct.param_id {
23220 let val = buf.get_u8();
23221 *v = val;
23222 }
23223 Ok(__struct)
23224 }
23225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23226 let mut __tmp = BytesMut::new(bytes);
23227 #[allow(clippy::absurd_extreme_comparisons)]
23228 #[allow(unused_comparisons)]
23229 if __tmp.remaining() < Self::ENCODED_LEN {
23230 panic!(
23231 "buffer is too small (need {} bytes, but got {})",
23232 Self::ENCODED_LEN,
23233 __tmp.remaining(),
23234 )
23235 }
23236 __tmp.put_i16_le(self.param_index);
23237 __tmp.put_u8(self.target_system);
23238 __tmp.put_u8(self.target_component);
23239 for val in &self.param_id {
23240 __tmp.put_u8(*val);
23241 }
23242 if matches!(version, MavlinkVersion::V2) {
23243 let len = __tmp.len();
23244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23245 } else {
23246 __tmp.len()
23247 }
23248 }
23249}
23250#[doc = "id: 23"]
23251#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23252#[derive(Debug, Clone, PartialEq)]
23253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23255pub struct PARAM_SET_DATA {
23256 #[doc = "Onboard parameter value"]
23257 pub param_value: f32,
23258 #[doc = "System ID"]
23259 pub target_system: u8,
23260 #[doc = "Component ID"]
23261 pub target_component: u8,
23262 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23263 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23264 pub param_id: [u8; 16],
23265 #[doc = "Onboard parameter type."]
23266 pub param_type: MavParamType,
23267}
23268impl PARAM_SET_DATA {
23269 pub const ENCODED_LEN: usize = 23usize;
23270 pub const DEFAULT: Self = Self {
23271 param_value: 0.0_f32,
23272 target_system: 0_u8,
23273 target_component: 0_u8,
23274 param_id: [0_u8; 16usize],
23275 param_type: MavParamType::DEFAULT,
23276 };
23277 #[cfg(feature = "arbitrary")]
23278 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23279 use arbitrary::{Arbitrary, Unstructured};
23280 let mut buf = [0u8; 1024];
23281 rng.fill_bytes(&mut buf);
23282 let mut unstructured = Unstructured::new(&buf);
23283 Self::arbitrary(&mut unstructured).unwrap_or_default()
23284 }
23285}
23286impl Default for PARAM_SET_DATA {
23287 fn default() -> Self {
23288 Self::DEFAULT.clone()
23289 }
23290}
23291impl MessageData for PARAM_SET_DATA {
23292 type Message = MavMessage;
23293 const ID: u32 = 23u32;
23294 const NAME: &'static str = "PARAM_SET";
23295 const EXTRA_CRC: u8 = 168u8;
23296 const ENCODED_LEN: usize = 23usize;
23297 fn deser(
23298 _version: MavlinkVersion,
23299 __input: &[u8],
23300 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23301 let avail_len = __input.len();
23302 let mut payload_buf = [0; Self::ENCODED_LEN];
23303 let mut buf = if avail_len < Self::ENCODED_LEN {
23304 payload_buf[0..avail_len].copy_from_slice(__input);
23305 Bytes::new(&payload_buf)
23306 } else {
23307 Bytes::new(__input)
23308 };
23309 let mut __struct = Self::default();
23310 __struct.param_value = buf.get_f32_le();
23311 __struct.target_system = buf.get_u8();
23312 __struct.target_component = buf.get_u8();
23313 for v in &mut __struct.param_id {
23314 let val = buf.get_u8();
23315 *v = val;
23316 }
23317 let tmp = buf.get_u8();
23318 __struct.param_type =
23319 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23320 enum_type: "MavParamType",
23321 value: tmp as u32,
23322 })?;
23323 Ok(__struct)
23324 }
23325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23326 let mut __tmp = BytesMut::new(bytes);
23327 #[allow(clippy::absurd_extreme_comparisons)]
23328 #[allow(unused_comparisons)]
23329 if __tmp.remaining() < Self::ENCODED_LEN {
23330 panic!(
23331 "buffer is too small (need {} bytes, but got {})",
23332 Self::ENCODED_LEN,
23333 __tmp.remaining(),
23334 )
23335 }
23336 __tmp.put_f32_le(self.param_value);
23337 __tmp.put_u8(self.target_system);
23338 __tmp.put_u8(self.target_component);
23339 for val in &self.param_id {
23340 __tmp.put_u8(*val);
23341 }
23342 __tmp.put_u8(self.param_type as u8);
23343 if matches!(version, MavlinkVersion::V2) {
23344 let len = __tmp.len();
23345 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23346 } else {
23347 __tmp.len()
23348 }
23349 }
23350}
23351#[doc = "id: 22"]
23352#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23353#[derive(Debug, Clone, PartialEq)]
23354#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23356pub struct PARAM_VALUE_DATA {
23357 #[doc = "Onboard parameter value"]
23358 pub param_value: f32,
23359 #[doc = "Total number of onboard parameters"]
23360 pub param_count: u16,
23361 #[doc = "Index of this onboard parameter"]
23362 pub param_index: u16,
23363 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23364 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23365 pub param_id: [u8; 16],
23366 #[doc = "Onboard parameter type."]
23367 pub param_type: MavParamType,
23368}
23369impl PARAM_VALUE_DATA {
23370 pub const ENCODED_LEN: usize = 25usize;
23371 pub const DEFAULT: Self = Self {
23372 param_value: 0.0_f32,
23373 param_count: 0_u16,
23374 param_index: 0_u16,
23375 param_id: [0_u8; 16usize],
23376 param_type: MavParamType::DEFAULT,
23377 };
23378 #[cfg(feature = "arbitrary")]
23379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23380 use arbitrary::{Arbitrary, Unstructured};
23381 let mut buf = [0u8; 1024];
23382 rng.fill_bytes(&mut buf);
23383 let mut unstructured = Unstructured::new(&buf);
23384 Self::arbitrary(&mut unstructured).unwrap_or_default()
23385 }
23386}
23387impl Default for PARAM_VALUE_DATA {
23388 fn default() -> Self {
23389 Self::DEFAULT.clone()
23390 }
23391}
23392impl MessageData for PARAM_VALUE_DATA {
23393 type Message = MavMessage;
23394 const ID: u32 = 22u32;
23395 const NAME: &'static str = "PARAM_VALUE";
23396 const EXTRA_CRC: u8 = 220u8;
23397 const ENCODED_LEN: usize = 25usize;
23398 fn deser(
23399 _version: MavlinkVersion,
23400 __input: &[u8],
23401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23402 let avail_len = __input.len();
23403 let mut payload_buf = [0; Self::ENCODED_LEN];
23404 let mut buf = if avail_len < Self::ENCODED_LEN {
23405 payload_buf[0..avail_len].copy_from_slice(__input);
23406 Bytes::new(&payload_buf)
23407 } else {
23408 Bytes::new(__input)
23409 };
23410 let mut __struct = Self::default();
23411 __struct.param_value = buf.get_f32_le();
23412 __struct.param_count = buf.get_u16_le();
23413 __struct.param_index = buf.get_u16_le();
23414 for v in &mut __struct.param_id {
23415 let val = buf.get_u8();
23416 *v = val;
23417 }
23418 let tmp = buf.get_u8();
23419 __struct.param_type =
23420 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23421 enum_type: "MavParamType",
23422 value: tmp as u32,
23423 })?;
23424 Ok(__struct)
23425 }
23426 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23427 let mut __tmp = BytesMut::new(bytes);
23428 #[allow(clippy::absurd_extreme_comparisons)]
23429 #[allow(unused_comparisons)]
23430 if __tmp.remaining() < Self::ENCODED_LEN {
23431 panic!(
23432 "buffer is too small (need {} bytes, but got {})",
23433 Self::ENCODED_LEN,
23434 __tmp.remaining(),
23435 )
23436 }
23437 __tmp.put_f32_le(self.param_value);
23438 __tmp.put_u16_le(self.param_count);
23439 __tmp.put_u16_le(self.param_index);
23440 for val in &self.param_id {
23441 __tmp.put_u8(*val);
23442 }
23443 __tmp.put_u8(self.param_type as u8);
23444 if matches!(version, MavlinkVersion::V2) {
23445 let len = __tmp.len();
23446 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23447 } else {
23448 __tmp.len()
23449 }
23450 }
23451}
23452#[doc = "id: 4"]
23453#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23454#[derive(Debug, Clone, PartialEq)]
23455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23457pub struct PING_DATA {
23458 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23459 pub time_usec: u64,
23460 #[doc = "PING sequence"]
23461 pub seq: u32,
23462 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23463 pub target_system: u8,
23464 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23465 pub target_component: u8,
23466}
23467impl PING_DATA {
23468 pub const ENCODED_LEN: usize = 14usize;
23469 pub const DEFAULT: Self = Self {
23470 time_usec: 0_u64,
23471 seq: 0_u32,
23472 target_system: 0_u8,
23473 target_component: 0_u8,
23474 };
23475 #[cfg(feature = "arbitrary")]
23476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23477 use arbitrary::{Arbitrary, Unstructured};
23478 let mut buf = [0u8; 1024];
23479 rng.fill_bytes(&mut buf);
23480 let mut unstructured = Unstructured::new(&buf);
23481 Self::arbitrary(&mut unstructured).unwrap_or_default()
23482 }
23483}
23484impl Default for PING_DATA {
23485 fn default() -> Self {
23486 Self::DEFAULT.clone()
23487 }
23488}
23489impl MessageData for PING_DATA {
23490 type Message = MavMessage;
23491 const ID: u32 = 4u32;
23492 const NAME: &'static str = "PING";
23493 const EXTRA_CRC: u8 = 237u8;
23494 const ENCODED_LEN: usize = 14usize;
23495 fn deser(
23496 _version: MavlinkVersion,
23497 __input: &[u8],
23498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23499 let avail_len = __input.len();
23500 let mut payload_buf = [0; Self::ENCODED_LEN];
23501 let mut buf = if avail_len < Self::ENCODED_LEN {
23502 payload_buf[0..avail_len].copy_from_slice(__input);
23503 Bytes::new(&payload_buf)
23504 } else {
23505 Bytes::new(__input)
23506 };
23507 let mut __struct = Self::default();
23508 __struct.time_usec = buf.get_u64_le();
23509 __struct.seq = buf.get_u32_le();
23510 __struct.target_system = buf.get_u8();
23511 __struct.target_component = buf.get_u8();
23512 Ok(__struct)
23513 }
23514 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23515 let mut __tmp = BytesMut::new(bytes);
23516 #[allow(clippy::absurd_extreme_comparisons)]
23517 #[allow(unused_comparisons)]
23518 if __tmp.remaining() < Self::ENCODED_LEN {
23519 panic!(
23520 "buffer is too small (need {} bytes, but got {})",
23521 Self::ENCODED_LEN,
23522 __tmp.remaining(),
23523 )
23524 }
23525 __tmp.put_u64_le(self.time_usec);
23526 __tmp.put_u32_le(self.seq);
23527 __tmp.put_u8(self.target_system);
23528 __tmp.put_u8(self.target_component);
23529 if matches!(version, MavlinkVersion::V2) {
23530 let len = __tmp.len();
23531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23532 } else {
23533 __tmp.len()
23534 }
23535 }
23536}
23537#[doc = "id: 258"]
23538#[doc = "Control vehicle tone generation (buzzer)."]
23539#[derive(Debug, Clone, PartialEq)]
23540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23542pub struct PLAY_TUNE_DATA {
23543 #[doc = "System ID"]
23544 pub target_system: u8,
23545 #[doc = "Component ID"]
23546 pub target_component: u8,
23547 #[doc = "tune in board specific format"]
23548 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23549 pub tune: [u8; 30],
23550 #[doc = "tune extension (appended to tune)"]
23551 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23552 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23553 pub tune2: [u8; 200],
23554}
23555impl PLAY_TUNE_DATA {
23556 pub const ENCODED_LEN: usize = 232usize;
23557 pub const DEFAULT: Self = Self {
23558 target_system: 0_u8,
23559 target_component: 0_u8,
23560 tune: [0_u8; 30usize],
23561 tune2: [0_u8; 200usize],
23562 };
23563 #[cfg(feature = "arbitrary")]
23564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23565 use arbitrary::{Arbitrary, Unstructured};
23566 let mut buf = [0u8; 1024];
23567 rng.fill_bytes(&mut buf);
23568 let mut unstructured = Unstructured::new(&buf);
23569 Self::arbitrary(&mut unstructured).unwrap_or_default()
23570 }
23571}
23572impl Default for PLAY_TUNE_DATA {
23573 fn default() -> Self {
23574 Self::DEFAULT.clone()
23575 }
23576}
23577impl MessageData for PLAY_TUNE_DATA {
23578 type Message = MavMessage;
23579 const ID: u32 = 258u32;
23580 const NAME: &'static str = "PLAY_TUNE";
23581 const EXTRA_CRC: u8 = 187u8;
23582 const ENCODED_LEN: usize = 232usize;
23583 fn deser(
23584 _version: MavlinkVersion,
23585 __input: &[u8],
23586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23587 let avail_len = __input.len();
23588 let mut payload_buf = [0; Self::ENCODED_LEN];
23589 let mut buf = if avail_len < Self::ENCODED_LEN {
23590 payload_buf[0..avail_len].copy_from_slice(__input);
23591 Bytes::new(&payload_buf)
23592 } else {
23593 Bytes::new(__input)
23594 };
23595 let mut __struct = Self::default();
23596 __struct.target_system = buf.get_u8();
23597 __struct.target_component = buf.get_u8();
23598 for v in &mut __struct.tune {
23599 let val = buf.get_u8();
23600 *v = val;
23601 }
23602 for v in &mut __struct.tune2 {
23603 let val = buf.get_u8();
23604 *v = val;
23605 }
23606 Ok(__struct)
23607 }
23608 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23609 let mut __tmp = BytesMut::new(bytes);
23610 #[allow(clippy::absurd_extreme_comparisons)]
23611 #[allow(unused_comparisons)]
23612 if __tmp.remaining() < Self::ENCODED_LEN {
23613 panic!(
23614 "buffer is too small (need {} bytes, but got {})",
23615 Self::ENCODED_LEN,
23616 __tmp.remaining(),
23617 )
23618 }
23619 __tmp.put_u8(self.target_system);
23620 __tmp.put_u8(self.target_component);
23621 for val in &self.tune {
23622 __tmp.put_u8(*val);
23623 }
23624 for val in &self.tune2 {
23625 __tmp.put_u8(*val);
23626 }
23627 if matches!(version, MavlinkVersion::V2) {
23628 let len = __tmp.len();
23629 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23630 } else {
23631 __tmp.len()
23632 }
23633 }
23634}
23635#[doc = "id: 400"]
23636#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23637#[derive(Debug, Clone, PartialEq)]
23638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23640pub struct PLAY_TUNE_V2_DATA {
23641 #[doc = "Tune format"]
23642 pub format: TuneFormat,
23643 #[doc = "System ID"]
23644 pub target_system: u8,
23645 #[doc = "Component ID"]
23646 pub target_component: u8,
23647 #[doc = "Tune definition as a NULL-terminated string."]
23648 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23649 pub tune: [u8; 248],
23650}
23651impl PLAY_TUNE_V2_DATA {
23652 pub const ENCODED_LEN: usize = 254usize;
23653 pub const DEFAULT: Self = Self {
23654 format: TuneFormat::DEFAULT,
23655 target_system: 0_u8,
23656 target_component: 0_u8,
23657 tune: [0_u8; 248usize],
23658 };
23659 #[cfg(feature = "arbitrary")]
23660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23661 use arbitrary::{Arbitrary, Unstructured};
23662 let mut buf = [0u8; 1024];
23663 rng.fill_bytes(&mut buf);
23664 let mut unstructured = Unstructured::new(&buf);
23665 Self::arbitrary(&mut unstructured).unwrap_or_default()
23666 }
23667}
23668impl Default for PLAY_TUNE_V2_DATA {
23669 fn default() -> Self {
23670 Self::DEFAULT.clone()
23671 }
23672}
23673impl MessageData for PLAY_TUNE_V2_DATA {
23674 type Message = MavMessage;
23675 const ID: u32 = 400u32;
23676 const NAME: &'static str = "PLAY_TUNE_V2";
23677 const EXTRA_CRC: u8 = 110u8;
23678 const ENCODED_LEN: usize = 254usize;
23679 fn deser(
23680 _version: MavlinkVersion,
23681 __input: &[u8],
23682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23683 let avail_len = __input.len();
23684 let mut payload_buf = [0; Self::ENCODED_LEN];
23685 let mut buf = if avail_len < Self::ENCODED_LEN {
23686 payload_buf[0..avail_len].copy_from_slice(__input);
23687 Bytes::new(&payload_buf)
23688 } else {
23689 Bytes::new(__input)
23690 };
23691 let mut __struct = Self::default();
23692 let tmp = buf.get_u32_le();
23693 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
23694 ::mavlink_core::error::ParserError::InvalidEnum {
23695 enum_type: "TuneFormat",
23696 value: tmp as u32,
23697 },
23698 )?;
23699 __struct.target_system = buf.get_u8();
23700 __struct.target_component = buf.get_u8();
23701 for v in &mut __struct.tune {
23702 let val = buf.get_u8();
23703 *v = val;
23704 }
23705 Ok(__struct)
23706 }
23707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23708 let mut __tmp = BytesMut::new(bytes);
23709 #[allow(clippy::absurd_extreme_comparisons)]
23710 #[allow(unused_comparisons)]
23711 if __tmp.remaining() < Self::ENCODED_LEN {
23712 panic!(
23713 "buffer is too small (need {} bytes, but got {})",
23714 Self::ENCODED_LEN,
23715 __tmp.remaining(),
23716 )
23717 }
23718 __tmp.put_u32_le(self.format as u32);
23719 __tmp.put_u8(self.target_system);
23720 __tmp.put_u8(self.target_component);
23721 for val in &self.tune {
23722 __tmp.put_u8(*val);
23723 }
23724 if matches!(version, MavlinkVersion::V2) {
23725 let len = __tmp.len();
23726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23727 } else {
23728 __tmp.len()
23729 }
23730 }
23731}
23732#[doc = "id: 87"]
23733#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
23734#[derive(Debug, Clone, PartialEq)]
23735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23736#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23737pub struct POSITION_TARGET_GLOBAL_INT_DATA {
23738 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
23739 pub time_boot_ms: u32,
23740 #[doc = "Latitude in WGS84 frame"]
23741 pub lat_int: i32,
23742 #[doc = "Longitude in WGS84 frame"]
23743 pub lon_int: i32,
23744 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
23745 pub alt: f32,
23746 #[doc = "X velocity in NED frame"]
23747 pub vx: f32,
23748 #[doc = "Y velocity in NED frame"]
23749 pub vy: f32,
23750 #[doc = "Z velocity in NED frame"]
23751 pub vz: f32,
23752 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23753 pub afx: f32,
23754 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23755 pub afy: f32,
23756 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23757 pub afz: f32,
23758 #[doc = "yaw setpoint"]
23759 pub yaw: f32,
23760 #[doc = "yaw rate setpoint"]
23761 pub yaw_rate: f32,
23762 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23763 pub type_mask: PositionTargetTypemask,
23764 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
23765 pub coordinate_frame: MavFrame,
23766}
23767impl POSITION_TARGET_GLOBAL_INT_DATA {
23768 pub const ENCODED_LEN: usize = 51usize;
23769 pub const DEFAULT: Self = Self {
23770 time_boot_ms: 0_u32,
23771 lat_int: 0_i32,
23772 lon_int: 0_i32,
23773 alt: 0.0_f32,
23774 vx: 0.0_f32,
23775 vy: 0.0_f32,
23776 vz: 0.0_f32,
23777 afx: 0.0_f32,
23778 afy: 0.0_f32,
23779 afz: 0.0_f32,
23780 yaw: 0.0_f32,
23781 yaw_rate: 0.0_f32,
23782 type_mask: PositionTargetTypemask::DEFAULT,
23783 coordinate_frame: MavFrame::DEFAULT,
23784 };
23785 #[cfg(feature = "arbitrary")]
23786 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23787 use arbitrary::{Arbitrary, Unstructured};
23788 let mut buf = [0u8; 1024];
23789 rng.fill_bytes(&mut buf);
23790 let mut unstructured = Unstructured::new(&buf);
23791 Self::arbitrary(&mut unstructured).unwrap_or_default()
23792 }
23793}
23794impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
23795 fn default() -> Self {
23796 Self::DEFAULT.clone()
23797 }
23798}
23799impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
23800 type Message = MavMessage;
23801 const ID: u32 = 87u32;
23802 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
23803 const EXTRA_CRC: u8 = 150u8;
23804 const ENCODED_LEN: usize = 51usize;
23805 fn deser(
23806 _version: MavlinkVersion,
23807 __input: &[u8],
23808 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23809 let avail_len = __input.len();
23810 let mut payload_buf = [0; Self::ENCODED_LEN];
23811 let mut buf = if avail_len < Self::ENCODED_LEN {
23812 payload_buf[0..avail_len].copy_from_slice(__input);
23813 Bytes::new(&payload_buf)
23814 } else {
23815 Bytes::new(__input)
23816 };
23817 let mut __struct = Self::default();
23818 __struct.time_boot_ms = buf.get_u32_le();
23819 __struct.lat_int = buf.get_i32_le();
23820 __struct.lon_int = buf.get_i32_le();
23821 __struct.alt = buf.get_f32_le();
23822 __struct.vx = buf.get_f32_le();
23823 __struct.vy = buf.get_f32_le();
23824 __struct.vz = buf.get_f32_le();
23825 __struct.afx = buf.get_f32_le();
23826 __struct.afy = buf.get_f32_le();
23827 __struct.afz = buf.get_f32_le();
23828 __struct.yaw = buf.get_f32_le();
23829 __struct.yaw_rate = buf.get_f32_le();
23830 let tmp = buf.get_u16_le();
23831 __struct.type_mask = PositionTargetTypemask::from_bits(
23832 tmp & PositionTargetTypemask::all().bits(),
23833 )
23834 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23835 flag_type: "PositionTargetTypemask",
23836 value: tmp as u32,
23837 })?;
23838 let tmp = buf.get_u8();
23839 __struct.coordinate_frame =
23840 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23841 enum_type: "MavFrame",
23842 value: tmp as u32,
23843 })?;
23844 Ok(__struct)
23845 }
23846 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23847 let mut __tmp = BytesMut::new(bytes);
23848 #[allow(clippy::absurd_extreme_comparisons)]
23849 #[allow(unused_comparisons)]
23850 if __tmp.remaining() < Self::ENCODED_LEN {
23851 panic!(
23852 "buffer is too small (need {} bytes, but got {})",
23853 Self::ENCODED_LEN,
23854 __tmp.remaining(),
23855 )
23856 }
23857 __tmp.put_u32_le(self.time_boot_ms);
23858 __tmp.put_i32_le(self.lat_int);
23859 __tmp.put_i32_le(self.lon_int);
23860 __tmp.put_f32_le(self.alt);
23861 __tmp.put_f32_le(self.vx);
23862 __tmp.put_f32_le(self.vy);
23863 __tmp.put_f32_le(self.vz);
23864 __tmp.put_f32_le(self.afx);
23865 __tmp.put_f32_le(self.afy);
23866 __tmp.put_f32_le(self.afz);
23867 __tmp.put_f32_le(self.yaw);
23868 __tmp.put_f32_le(self.yaw_rate);
23869 __tmp.put_u16_le(self.type_mask.bits());
23870 __tmp.put_u8(self.coordinate_frame as u8);
23871 if matches!(version, MavlinkVersion::V2) {
23872 let len = __tmp.len();
23873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23874 } else {
23875 __tmp.len()
23876 }
23877 }
23878}
23879#[doc = "id: 85"]
23880#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
23881#[derive(Debug, Clone, PartialEq)]
23882#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23883#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23884pub struct POSITION_TARGET_LOCAL_NED_DATA {
23885 #[doc = "Timestamp (time since system boot)."]
23886 pub time_boot_ms: u32,
23887 #[doc = "X Position in NED frame"]
23888 pub x: f32,
23889 #[doc = "Y Position in NED frame"]
23890 pub y: f32,
23891 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
23892 pub z: f32,
23893 #[doc = "X velocity in NED frame"]
23894 pub vx: f32,
23895 #[doc = "Y velocity in NED frame"]
23896 pub vy: f32,
23897 #[doc = "Z velocity in NED frame"]
23898 pub vz: f32,
23899 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23900 pub afx: f32,
23901 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23902 pub afy: f32,
23903 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23904 pub afz: f32,
23905 #[doc = "yaw setpoint"]
23906 pub yaw: f32,
23907 #[doc = "yaw rate setpoint"]
23908 pub yaw_rate: f32,
23909 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23910 pub type_mask: PositionTargetTypemask,
23911 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
23912 pub coordinate_frame: MavFrame,
23913}
23914impl POSITION_TARGET_LOCAL_NED_DATA {
23915 pub const ENCODED_LEN: usize = 51usize;
23916 pub const DEFAULT: Self = Self {
23917 time_boot_ms: 0_u32,
23918 x: 0.0_f32,
23919 y: 0.0_f32,
23920 z: 0.0_f32,
23921 vx: 0.0_f32,
23922 vy: 0.0_f32,
23923 vz: 0.0_f32,
23924 afx: 0.0_f32,
23925 afy: 0.0_f32,
23926 afz: 0.0_f32,
23927 yaw: 0.0_f32,
23928 yaw_rate: 0.0_f32,
23929 type_mask: PositionTargetTypemask::DEFAULT,
23930 coordinate_frame: MavFrame::DEFAULT,
23931 };
23932 #[cfg(feature = "arbitrary")]
23933 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23934 use arbitrary::{Arbitrary, Unstructured};
23935 let mut buf = [0u8; 1024];
23936 rng.fill_bytes(&mut buf);
23937 let mut unstructured = Unstructured::new(&buf);
23938 Self::arbitrary(&mut unstructured).unwrap_or_default()
23939 }
23940}
23941impl Default for POSITION_TARGET_LOCAL_NED_DATA {
23942 fn default() -> Self {
23943 Self::DEFAULT.clone()
23944 }
23945}
23946impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
23947 type Message = MavMessage;
23948 const ID: u32 = 85u32;
23949 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
23950 const EXTRA_CRC: u8 = 140u8;
23951 const ENCODED_LEN: usize = 51usize;
23952 fn deser(
23953 _version: MavlinkVersion,
23954 __input: &[u8],
23955 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23956 let avail_len = __input.len();
23957 let mut payload_buf = [0; Self::ENCODED_LEN];
23958 let mut buf = if avail_len < Self::ENCODED_LEN {
23959 payload_buf[0..avail_len].copy_from_slice(__input);
23960 Bytes::new(&payload_buf)
23961 } else {
23962 Bytes::new(__input)
23963 };
23964 let mut __struct = Self::default();
23965 __struct.time_boot_ms = buf.get_u32_le();
23966 __struct.x = buf.get_f32_le();
23967 __struct.y = buf.get_f32_le();
23968 __struct.z = buf.get_f32_le();
23969 __struct.vx = buf.get_f32_le();
23970 __struct.vy = buf.get_f32_le();
23971 __struct.vz = buf.get_f32_le();
23972 __struct.afx = buf.get_f32_le();
23973 __struct.afy = buf.get_f32_le();
23974 __struct.afz = buf.get_f32_le();
23975 __struct.yaw = buf.get_f32_le();
23976 __struct.yaw_rate = buf.get_f32_le();
23977 let tmp = buf.get_u16_le();
23978 __struct.type_mask = PositionTargetTypemask::from_bits(
23979 tmp & PositionTargetTypemask::all().bits(),
23980 )
23981 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23982 flag_type: "PositionTargetTypemask",
23983 value: tmp as u32,
23984 })?;
23985 let tmp = buf.get_u8();
23986 __struct.coordinate_frame =
23987 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23988 enum_type: "MavFrame",
23989 value: tmp as u32,
23990 })?;
23991 Ok(__struct)
23992 }
23993 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23994 let mut __tmp = BytesMut::new(bytes);
23995 #[allow(clippy::absurd_extreme_comparisons)]
23996 #[allow(unused_comparisons)]
23997 if __tmp.remaining() < Self::ENCODED_LEN {
23998 panic!(
23999 "buffer is too small (need {} bytes, but got {})",
24000 Self::ENCODED_LEN,
24001 __tmp.remaining(),
24002 )
24003 }
24004 __tmp.put_u32_le(self.time_boot_ms);
24005 __tmp.put_f32_le(self.x);
24006 __tmp.put_f32_le(self.y);
24007 __tmp.put_f32_le(self.z);
24008 __tmp.put_f32_le(self.vx);
24009 __tmp.put_f32_le(self.vy);
24010 __tmp.put_f32_le(self.vz);
24011 __tmp.put_f32_le(self.afx);
24012 __tmp.put_f32_le(self.afy);
24013 __tmp.put_f32_le(self.afz);
24014 __tmp.put_f32_le(self.yaw);
24015 __tmp.put_f32_le(self.yaw_rate);
24016 __tmp.put_u16_le(self.type_mask.bits());
24017 __tmp.put_u8(self.coordinate_frame as u8);
24018 if matches!(version, MavlinkVersion::V2) {
24019 let len = __tmp.len();
24020 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24021 } else {
24022 __tmp.len()
24023 }
24024 }
24025}
24026#[doc = "id: 125"]
24027#[doc = "Power supply status."]
24028#[derive(Debug, Clone, PartialEq)]
24029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24031pub struct POWER_STATUS_DATA {
24032 #[doc = "5V rail voltage."]
24033 pub Vcc: u16,
24034 #[doc = "Servo rail voltage."]
24035 pub Vservo: u16,
24036 #[doc = "Bitmap of power supply status flags."]
24037 pub flags: MavPowerStatus,
24038}
24039impl POWER_STATUS_DATA {
24040 pub const ENCODED_LEN: usize = 6usize;
24041 pub const DEFAULT: Self = Self {
24042 Vcc: 0_u16,
24043 Vservo: 0_u16,
24044 flags: MavPowerStatus::DEFAULT,
24045 };
24046 #[cfg(feature = "arbitrary")]
24047 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24048 use arbitrary::{Arbitrary, Unstructured};
24049 let mut buf = [0u8; 1024];
24050 rng.fill_bytes(&mut buf);
24051 let mut unstructured = Unstructured::new(&buf);
24052 Self::arbitrary(&mut unstructured).unwrap_or_default()
24053 }
24054}
24055impl Default for POWER_STATUS_DATA {
24056 fn default() -> Self {
24057 Self::DEFAULT.clone()
24058 }
24059}
24060impl MessageData for POWER_STATUS_DATA {
24061 type Message = MavMessage;
24062 const ID: u32 = 125u32;
24063 const NAME: &'static str = "POWER_STATUS";
24064 const EXTRA_CRC: u8 = 203u8;
24065 const ENCODED_LEN: usize = 6usize;
24066 fn deser(
24067 _version: MavlinkVersion,
24068 __input: &[u8],
24069 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24070 let avail_len = __input.len();
24071 let mut payload_buf = [0; Self::ENCODED_LEN];
24072 let mut buf = if avail_len < Self::ENCODED_LEN {
24073 payload_buf[0..avail_len].copy_from_slice(__input);
24074 Bytes::new(&payload_buf)
24075 } else {
24076 Bytes::new(__input)
24077 };
24078 let mut __struct = Self::default();
24079 __struct.Vcc = buf.get_u16_le();
24080 __struct.Vservo = buf.get_u16_le();
24081 let tmp = buf.get_u16_le();
24082 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
24083 ::mavlink_core::error::ParserError::InvalidFlag {
24084 flag_type: "MavPowerStatus",
24085 value: tmp as u32,
24086 },
24087 )?;
24088 Ok(__struct)
24089 }
24090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24091 let mut __tmp = BytesMut::new(bytes);
24092 #[allow(clippy::absurd_extreme_comparisons)]
24093 #[allow(unused_comparisons)]
24094 if __tmp.remaining() < Self::ENCODED_LEN {
24095 panic!(
24096 "buffer is too small (need {} bytes, but got {})",
24097 Self::ENCODED_LEN,
24098 __tmp.remaining(),
24099 )
24100 }
24101 __tmp.put_u16_le(self.Vcc);
24102 __tmp.put_u16_le(self.Vservo);
24103 __tmp.put_u16_le(self.flags.bits());
24104 if matches!(version, MavlinkVersion::V2) {
24105 let len = __tmp.len();
24106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24107 } else {
24108 __tmp.len()
24109 }
24110 }
24111}
24112#[doc = "id: 300"]
24113#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24114#[derive(Debug, Clone, PartialEq)]
24115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24117pub struct PROTOCOL_VERSION_DATA {
24118 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24119 pub version: u16,
24120 #[doc = "Minimum MAVLink version supported"]
24121 pub min_version: u16,
24122 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24123 pub max_version: u16,
24124 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24125 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24126 pub spec_version_hash: [u8; 8],
24127 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24128 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24129 pub library_version_hash: [u8; 8],
24130}
24131impl PROTOCOL_VERSION_DATA {
24132 pub const ENCODED_LEN: usize = 22usize;
24133 pub const DEFAULT: Self = Self {
24134 version: 0_u16,
24135 min_version: 0_u16,
24136 max_version: 0_u16,
24137 spec_version_hash: [0_u8; 8usize],
24138 library_version_hash: [0_u8; 8usize],
24139 };
24140 #[cfg(feature = "arbitrary")]
24141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24142 use arbitrary::{Arbitrary, Unstructured};
24143 let mut buf = [0u8; 1024];
24144 rng.fill_bytes(&mut buf);
24145 let mut unstructured = Unstructured::new(&buf);
24146 Self::arbitrary(&mut unstructured).unwrap_or_default()
24147 }
24148}
24149impl Default for PROTOCOL_VERSION_DATA {
24150 fn default() -> Self {
24151 Self::DEFAULT.clone()
24152 }
24153}
24154impl MessageData for PROTOCOL_VERSION_DATA {
24155 type Message = MavMessage;
24156 const ID: u32 = 300u32;
24157 const NAME: &'static str = "PROTOCOL_VERSION";
24158 const EXTRA_CRC: u8 = 217u8;
24159 const ENCODED_LEN: usize = 22usize;
24160 fn deser(
24161 _version: MavlinkVersion,
24162 __input: &[u8],
24163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24164 let avail_len = __input.len();
24165 let mut payload_buf = [0; Self::ENCODED_LEN];
24166 let mut buf = if avail_len < Self::ENCODED_LEN {
24167 payload_buf[0..avail_len].copy_from_slice(__input);
24168 Bytes::new(&payload_buf)
24169 } else {
24170 Bytes::new(__input)
24171 };
24172 let mut __struct = Self::default();
24173 __struct.version = buf.get_u16_le();
24174 __struct.min_version = buf.get_u16_le();
24175 __struct.max_version = buf.get_u16_le();
24176 for v in &mut __struct.spec_version_hash {
24177 let val = buf.get_u8();
24178 *v = val;
24179 }
24180 for v in &mut __struct.library_version_hash {
24181 let val = buf.get_u8();
24182 *v = val;
24183 }
24184 Ok(__struct)
24185 }
24186 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24187 let mut __tmp = BytesMut::new(bytes);
24188 #[allow(clippy::absurd_extreme_comparisons)]
24189 #[allow(unused_comparisons)]
24190 if __tmp.remaining() < Self::ENCODED_LEN {
24191 panic!(
24192 "buffer is too small (need {} bytes, but got {})",
24193 Self::ENCODED_LEN,
24194 __tmp.remaining(),
24195 )
24196 }
24197 __tmp.put_u16_le(self.version);
24198 __tmp.put_u16_le(self.min_version);
24199 __tmp.put_u16_le(self.max_version);
24200 for val in &self.spec_version_hash {
24201 __tmp.put_u8(*val);
24202 }
24203 for val in &self.library_version_hash {
24204 __tmp.put_u8(*val);
24205 }
24206 if matches!(version, MavlinkVersion::V2) {
24207 let len = __tmp.len();
24208 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24209 } else {
24210 __tmp.len()
24211 }
24212 }
24213}
24214#[doc = "id: 109"]
24215#[doc = "Status generated by radio and injected into MAVLink stream."]
24216#[derive(Debug, Clone, PartialEq)]
24217#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24219pub struct RADIO_STATUS_DATA {
24220 #[doc = "Count of radio packet receive errors (since boot)."]
24221 pub rxerrors: u16,
24222 #[doc = "Count of error corrected radio packets (since boot)."]
24223 pub fixed: u16,
24224 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24225 pub rssi: u8,
24226 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24227 pub remrssi: u8,
24228 #[doc = "Remaining free transmitter buffer space."]
24229 pub txbuf: u8,
24230 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24231 pub noise: u8,
24232 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24233 pub remnoise: u8,
24234}
24235impl RADIO_STATUS_DATA {
24236 pub const ENCODED_LEN: usize = 9usize;
24237 pub const DEFAULT: Self = Self {
24238 rxerrors: 0_u16,
24239 fixed: 0_u16,
24240 rssi: 0_u8,
24241 remrssi: 0_u8,
24242 txbuf: 0_u8,
24243 noise: 0_u8,
24244 remnoise: 0_u8,
24245 };
24246 #[cfg(feature = "arbitrary")]
24247 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24248 use arbitrary::{Arbitrary, Unstructured};
24249 let mut buf = [0u8; 1024];
24250 rng.fill_bytes(&mut buf);
24251 let mut unstructured = Unstructured::new(&buf);
24252 Self::arbitrary(&mut unstructured).unwrap_or_default()
24253 }
24254}
24255impl Default for RADIO_STATUS_DATA {
24256 fn default() -> Self {
24257 Self::DEFAULT.clone()
24258 }
24259}
24260impl MessageData for RADIO_STATUS_DATA {
24261 type Message = MavMessage;
24262 const ID: u32 = 109u32;
24263 const NAME: &'static str = "RADIO_STATUS";
24264 const EXTRA_CRC: u8 = 185u8;
24265 const ENCODED_LEN: usize = 9usize;
24266 fn deser(
24267 _version: MavlinkVersion,
24268 __input: &[u8],
24269 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24270 let avail_len = __input.len();
24271 let mut payload_buf = [0; Self::ENCODED_LEN];
24272 let mut buf = if avail_len < Self::ENCODED_LEN {
24273 payload_buf[0..avail_len].copy_from_slice(__input);
24274 Bytes::new(&payload_buf)
24275 } else {
24276 Bytes::new(__input)
24277 };
24278 let mut __struct = Self::default();
24279 __struct.rxerrors = buf.get_u16_le();
24280 __struct.fixed = buf.get_u16_le();
24281 __struct.rssi = buf.get_u8();
24282 __struct.remrssi = buf.get_u8();
24283 __struct.txbuf = buf.get_u8();
24284 __struct.noise = buf.get_u8();
24285 __struct.remnoise = buf.get_u8();
24286 Ok(__struct)
24287 }
24288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24289 let mut __tmp = BytesMut::new(bytes);
24290 #[allow(clippy::absurd_extreme_comparisons)]
24291 #[allow(unused_comparisons)]
24292 if __tmp.remaining() < Self::ENCODED_LEN {
24293 panic!(
24294 "buffer is too small (need {} bytes, but got {})",
24295 Self::ENCODED_LEN,
24296 __tmp.remaining(),
24297 )
24298 }
24299 __tmp.put_u16_le(self.rxerrors);
24300 __tmp.put_u16_le(self.fixed);
24301 __tmp.put_u8(self.rssi);
24302 __tmp.put_u8(self.remrssi);
24303 __tmp.put_u8(self.txbuf);
24304 __tmp.put_u8(self.noise);
24305 __tmp.put_u8(self.remnoise);
24306 if matches!(version, MavlinkVersion::V2) {
24307 let len = __tmp.len();
24308 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24309 } else {
24310 __tmp.len()
24311 }
24312 }
24313}
24314#[doc = "id: 27"]
24315#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24316#[derive(Debug, Clone, PartialEq)]
24317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24319pub struct RAW_IMU_DATA {
24320 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24321 pub time_usec: u64,
24322 #[doc = "X acceleration (raw)"]
24323 pub xacc: i16,
24324 #[doc = "Y acceleration (raw)"]
24325 pub yacc: i16,
24326 #[doc = "Z acceleration (raw)"]
24327 pub zacc: i16,
24328 #[doc = "Angular speed around X axis (raw)"]
24329 pub xgyro: i16,
24330 #[doc = "Angular speed around Y axis (raw)"]
24331 pub ygyro: i16,
24332 #[doc = "Angular speed around Z axis (raw)"]
24333 pub zgyro: i16,
24334 #[doc = "X Magnetic field (raw)"]
24335 pub xmag: i16,
24336 #[doc = "Y Magnetic field (raw)"]
24337 pub ymag: i16,
24338 #[doc = "Z Magnetic field (raw)"]
24339 pub zmag: i16,
24340 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24341 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24342 pub id: u8,
24343 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24344 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24345 pub temperature: i16,
24346}
24347impl RAW_IMU_DATA {
24348 pub const ENCODED_LEN: usize = 29usize;
24349 pub const DEFAULT: Self = Self {
24350 time_usec: 0_u64,
24351 xacc: 0_i16,
24352 yacc: 0_i16,
24353 zacc: 0_i16,
24354 xgyro: 0_i16,
24355 ygyro: 0_i16,
24356 zgyro: 0_i16,
24357 xmag: 0_i16,
24358 ymag: 0_i16,
24359 zmag: 0_i16,
24360 id: 0_u8,
24361 temperature: 0_i16,
24362 };
24363 #[cfg(feature = "arbitrary")]
24364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24365 use arbitrary::{Arbitrary, Unstructured};
24366 let mut buf = [0u8; 1024];
24367 rng.fill_bytes(&mut buf);
24368 let mut unstructured = Unstructured::new(&buf);
24369 Self::arbitrary(&mut unstructured).unwrap_or_default()
24370 }
24371}
24372impl Default for RAW_IMU_DATA {
24373 fn default() -> Self {
24374 Self::DEFAULT.clone()
24375 }
24376}
24377impl MessageData for RAW_IMU_DATA {
24378 type Message = MavMessage;
24379 const ID: u32 = 27u32;
24380 const NAME: &'static str = "RAW_IMU";
24381 const EXTRA_CRC: u8 = 144u8;
24382 const ENCODED_LEN: usize = 29usize;
24383 fn deser(
24384 _version: MavlinkVersion,
24385 __input: &[u8],
24386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24387 let avail_len = __input.len();
24388 let mut payload_buf = [0; Self::ENCODED_LEN];
24389 let mut buf = if avail_len < Self::ENCODED_LEN {
24390 payload_buf[0..avail_len].copy_from_slice(__input);
24391 Bytes::new(&payload_buf)
24392 } else {
24393 Bytes::new(__input)
24394 };
24395 let mut __struct = Self::default();
24396 __struct.time_usec = buf.get_u64_le();
24397 __struct.xacc = buf.get_i16_le();
24398 __struct.yacc = buf.get_i16_le();
24399 __struct.zacc = buf.get_i16_le();
24400 __struct.xgyro = buf.get_i16_le();
24401 __struct.ygyro = buf.get_i16_le();
24402 __struct.zgyro = buf.get_i16_le();
24403 __struct.xmag = buf.get_i16_le();
24404 __struct.ymag = buf.get_i16_le();
24405 __struct.zmag = buf.get_i16_le();
24406 __struct.id = buf.get_u8();
24407 __struct.temperature = buf.get_i16_le();
24408 Ok(__struct)
24409 }
24410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24411 let mut __tmp = BytesMut::new(bytes);
24412 #[allow(clippy::absurd_extreme_comparisons)]
24413 #[allow(unused_comparisons)]
24414 if __tmp.remaining() < Self::ENCODED_LEN {
24415 panic!(
24416 "buffer is too small (need {} bytes, but got {})",
24417 Self::ENCODED_LEN,
24418 __tmp.remaining(),
24419 )
24420 }
24421 __tmp.put_u64_le(self.time_usec);
24422 __tmp.put_i16_le(self.xacc);
24423 __tmp.put_i16_le(self.yacc);
24424 __tmp.put_i16_le(self.zacc);
24425 __tmp.put_i16_le(self.xgyro);
24426 __tmp.put_i16_le(self.ygyro);
24427 __tmp.put_i16_le(self.zgyro);
24428 __tmp.put_i16_le(self.xmag);
24429 __tmp.put_i16_le(self.ymag);
24430 __tmp.put_i16_le(self.zmag);
24431 __tmp.put_u8(self.id);
24432 __tmp.put_i16_le(self.temperature);
24433 if matches!(version, MavlinkVersion::V2) {
24434 let len = __tmp.len();
24435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24436 } else {
24437 __tmp.len()
24438 }
24439 }
24440}
24441#[doc = "id: 28"]
24442#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24443#[derive(Debug, Clone, PartialEq)]
24444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24446pub struct RAW_PRESSURE_DATA {
24447 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24448 pub time_usec: u64,
24449 #[doc = "Absolute pressure (raw)"]
24450 pub press_abs: i16,
24451 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24452 pub press_diff1: i16,
24453 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24454 pub press_diff2: i16,
24455 #[doc = "Raw Temperature measurement (raw)"]
24456 pub temperature: i16,
24457}
24458impl RAW_PRESSURE_DATA {
24459 pub const ENCODED_LEN: usize = 16usize;
24460 pub const DEFAULT: Self = Self {
24461 time_usec: 0_u64,
24462 press_abs: 0_i16,
24463 press_diff1: 0_i16,
24464 press_diff2: 0_i16,
24465 temperature: 0_i16,
24466 };
24467 #[cfg(feature = "arbitrary")]
24468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24469 use arbitrary::{Arbitrary, Unstructured};
24470 let mut buf = [0u8; 1024];
24471 rng.fill_bytes(&mut buf);
24472 let mut unstructured = Unstructured::new(&buf);
24473 Self::arbitrary(&mut unstructured).unwrap_or_default()
24474 }
24475}
24476impl Default for RAW_PRESSURE_DATA {
24477 fn default() -> Self {
24478 Self::DEFAULT.clone()
24479 }
24480}
24481impl MessageData for RAW_PRESSURE_DATA {
24482 type Message = MavMessage;
24483 const ID: u32 = 28u32;
24484 const NAME: &'static str = "RAW_PRESSURE";
24485 const EXTRA_CRC: u8 = 67u8;
24486 const ENCODED_LEN: usize = 16usize;
24487 fn deser(
24488 _version: MavlinkVersion,
24489 __input: &[u8],
24490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24491 let avail_len = __input.len();
24492 let mut payload_buf = [0; Self::ENCODED_LEN];
24493 let mut buf = if avail_len < Self::ENCODED_LEN {
24494 payload_buf[0..avail_len].copy_from_slice(__input);
24495 Bytes::new(&payload_buf)
24496 } else {
24497 Bytes::new(__input)
24498 };
24499 let mut __struct = Self::default();
24500 __struct.time_usec = buf.get_u64_le();
24501 __struct.press_abs = buf.get_i16_le();
24502 __struct.press_diff1 = buf.get_i16_le();
24503 __struct.press_diff2 = buf.get_i16_le();
24504 __struct.temperature = buf.get_i16_le();
24505 Ok(__struct)
24506 }
24507 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24508 let mut __tmp = BytesMut::new(bytes);
24509 #[allow(clippy::absurd_extreme_comparisons)]
24510 #[allow(unused_comparisons)]
24511 if __tmp.remaining() < Self::ENCODED_LEN {
24512 panic!(
24513 "buffer is too small (need {} bytes, but got {})",
24514 Self::ENCODED_LEN,
24515 __tmp.remaining(),
24516 )
24517 }
24518 __tmp.put_u64_le(self.time_usec);
24519 __tmp.put_i16_le(self.press_abs);
24520 __tmp.put_i16_le(self.press_diff1);
24521 __tmp.put_i16_le(self.press_diff2);
24522 __tmp.put_i16_le(self.temperature);
24523 if matches!(version, MavlinkVersion::V2) {
24524 let len = __tmp.len();
24525 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24526 } else {
24527 __tmp.len()
24528 }
24529 }
24530}
24531#[doc = "id: 339"]
24532#[doc = "RPM sensor data message."]
24533#[derive(Debug, Clone, PartialEq)]
24534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24536pub struct RAW_RPM_DATA {
24537 #[doc = "Indicated rate"]
24538 pub frequency: f32,
24539 #[doc = "Index of this RPM sensor (0-indexed)"]
24540 pub index: u8,
24541}
24542impl RAW_RPM_DATA {
24543 pub const ENCODED_LEN: usize = 5usize;
24544 pub const DEFAULT: Self = Self {
24545 frequency: 0.0_f32,
24546 index: 0_u8,
24547 };
24548 #[cfg(feature = "arbitrary")]
24549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24550 use arbitrary::{Arbitrary, Unstructured};
24551 let mut buf = [0u8; 1024];
24552 rng.fill_bytes(&mut buf);
24553 let mut unstructured = Unstructured::new(&buf);
24554 Self::arbitrary(&mut unstructured).unwrap_or_default()
24555 }
24556}
24557impl Default for RAW_RPM_DATA {
24558 fn default() -> Self {
24559 Self::DEFAULT.clone()
24560 }
24561}
24562impl MessageData for RAW_RPM_DATA {
24563 type Message = MavMessage;
24564 const ID: u32 = 339u32;
24565 const NAME: &'static str = "RAW_RPM";
24566 const EXTRA_CRC: u8 = 199u8;
24567 const ENCODED_LEN: usize = 5usize;
24568 fn deser(
24569 _version: MavlinkVersion,
24570 __input: &[u8],
24571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24572 let avail_len = __input.len();
24573 let mut payload_buf = [0; Self::ENCODED_LEN];
24574 let mut buf = if avail_len < Self::ENCODED_LEN {
24575 payload_buf[0..avail_len].copy_from_slice(__input);
24576 Bytes::new(&payload_buf)
24577 } else {
24578 Bytes::new(__input)
24579 };
24580 let mut __struct = Self::default();
24581 __struct.frequency = buf.get_f32_le();
24582 __struct.index = buf.get_u8();
24583 Ok(__struct)
24584 }
24585 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24586 let mut __tmp = BytesMut::new(bytes);
24587 #[allow(clippy::absurd_extreme_comparisons)]
24588 #[allow(unused_comparisons)]
24589 if __tmp.remaining() < Self::ENCODED_LEN {
24590 panic!(
24591 "buffer is too small (need {} bytes, but got {})",
24592 Self::ENCODED_LEN,
24593 __tmp.remaining(),
24594 )
24595 }
24596 __tmp.put_f32_le(self.frequency);
24597 __tmp.put_u8(self.index);
24598 if matches!(version, MavlinkVersion::V2) {
24599 let len = __tmp.len();
24600 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24601 } else {
24602 __tmp.len()
24603 }
24604 }
24605}
24606#[doc = "id: 65"]
24607#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24608#[derive(Debug, Clone, PartialEq)]
24609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24611pub struct RC_CHANNELS_DATA {
24612 #[doc = "Timestamp (time since system boot)."]
24613 pub time_boot_ms: u32,
24614 #[doc = "RC channel 1 value."]
24615 pub chan1_raw: u16,
24616 #[doc = "RC channel 2 value."]
24617 pub chan2_raw: u16,
24618 #[doc = "RC channel 3 value."]
24619 pub chan3_raw: u16,
24620 #[doc = "RC channel 4 value."]
24621 pub chan4_raw: u16,
24622 #[doc = "RC channel 5 value."]
24623 pub chan5_raw: u16,
24624 #[doc = "RC channel 6 value."]
24625 pub chan6_raw: u16,
24626 #[doc = "RC channel 7 value."]
24627 pub chan7_raw: u16,
24628 #[doc = "RC channel 8 value."]
24629 pub chan8_raw: u16,
24630 #[doc = "RC channel 9 value."]
24631 pub chan9_raw: u16,
24632 #[doc = "RC channel 10 value."]
24633 pub chan10_raw: u16,
24634 #[doc = "RC channel 11 value."]
24635 pub chan11_raw: u16,
24636 #[doc = "RC channel 12 value."]
24637 pub chan12_raw: u16,
24638 #[doc = "RC channel 13 value."]
24639 pub chan13_raw: u16,
24640 #[doc = "RC channel 14 value."]
24641 pub chan14_raw: u16,
24642 #[doc = "RC channel 15 value."]
24643 pub chan15_raw: u16,
24644 #[doc = "RC channel 16 value."]
24645 pub chan16_raw: u16,
24646 #[doc = "RC channel 17 value."]
24647 pub chan17_raw: u16,
24648 #[doc = "RC channel 18 value."]
24649 pub chan18_raw: u16,
24650 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24651 pub chancount: u8,
24652 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24653 pub rssi: u8,
24654}
24655impl RC_CHANNELS_DATA {
24656 pub const ENCODED_LEN: usize = 42usize;
24657 pub const DEFAULT: Self = Self {
24658 time_boot_ms: 0_u32,
24659 chan1_raw: 0_u16,
24660 chan2_raw: 0_u16,
24661 chan3_raw: 0_u16,
24662 chan4_raw: 0_u16,
24663 chan5_raw: 0_u16,
24664 chan6_raw: 0_u16,
24665 chan7_raw: 0_u16,
24666 chan8_raw: 0_u16,
24667 chan9_raw: 0_u16,
24668 chan10_raw: 0_u16,
24669 chan11_raw: 0_u16,
24670 chan12_raw: 0_u16,
24671 chan13_raw: 0_u16,
24672 chan14_raw: 0_u16,
24673 chan15_raw: 0_u16,
24674 chan16_raw: 0_u16,
24675 chan17_raw: 0_u16,
24676 chan18_raw: 0_u16,
24677 chancount: 0_u8,
24678 rssi: 0_u8,
24679 };
24680 #[cfg(feature = "arbitrary")]
24681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24682 use arbitrary::{Arbitrary, Unstructured};
24683 let mut buf = [0u8; 1024];
24684 rng.fill_bytes(&mut buf);
24685 let mut unstructured = Unstructured::new(&buf);
24686 Self::arbitrary(&mut unstructured).unwrap_or_default()
24687 }
24688}
24689impl Default for RC_CHANNELS_DATA {
24690 fn default() -> Self {
24691 Self::DEFAULT.clone()
24692 }
24693}
24694impl MessageData for RC_CHANNELS_DATA {
24695 type Message = MavMessage;
24696 const ID: u32 = 65u32;
24697 const NAME: &'static str = "RC_CHANNELS";
24698 const EXTRA_CRC: u8 = 118u8;
24699 const ENCODED_LEN: usize = 42usize;
24700 fn deser(
24701 _version: MavlinkVersion,
24702 __input: &[u8],
24703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24704 let avail_len = __input.len();
24705 let mut payload_buf = [0; Self::ENCODED_LEN];
24706 let mut buf = if avail_len < Self::ENCODED_LEN {
24707 payload_buf[0..avail_len].copy_from_slice(__input);
24708 Bytes::new(&payload_buf)
24709 } else {
24710 Bytes::new(__input)
24711 };
24712 let mut __struct = Self::default();
24713 __struct.time_boot_ms = buf.get_u32_le();
24714 __struct.chan1_raw = buf.get_u16_le();
24715 __struct.chan2_raw = buf.get_u16_le();
24716 __struct.chan3_raw = buf.get_u16_le();
24717 __struct.chan4_raw = buf.get_u16_le();
24718 __struct.chan5_raw = buf.get_u16_le();
24719 __struct.chan6_raw = buf.get_u16_le();
24720 __struct.chan7_raw = buf.get_u16_le();
24721 __struct.chan8_raw = buf.get_u16_le();
24722 __struct.chan9_raw = buf.get_u16_le();
24723 __struct.chan10_raw = buf.get_u16_le();
24724 __struct.chan11_raw = buf.get_u16_le();
24725 __struct.chan12_raw = buf.get_u16_le();
24726 __struct.chan13_raw = buf.get_u16_le();
24727 __struct.chan14_raw = buf.get_u16_le();
24728 __struct.chan15_raw = buf.get_u16_le();
24729 __struct.chan16_raw = buf.get_u16_le();
24730 __struct.chan17_raw = buf.get_u16_le();
24731 __struct.chan18_raw = buf.get_u16_le();
24732 __struct.chancount = buf.get_u8();
24733 __struct.rssi = buf.get_u8();
24734 Ok(__struct)
24735 }
24736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24737 let mut __tmp = BytesMut::new(bytes);
24738 #[allow(clippy::absurd_extreme_comparisons)]
24739 #[allow(unused_comparisons)]
24740 if __tmp.remaining() < Self::ENCODED_LEN {
24741 panic!(
24742 "buffer is too small (need {} bytes, but got {})",
24743 Self::ENCODED_LEN,
24744 __tmp.remaining(),
24745 )
24746 }
24747 __tmp.put_u32_le(self.time_boot_ms);
24748 __tmp.put_u16_le(self.chan1_raw);
24749 __tmp.put_u16_le(self.chan2_raw);
24750 __tmp.put_u16_le(self.chan3_raw);
24751 __tmp.put_u16_le(self.chan4_raw);
24752 __tmp.put_u16_le(self.chan5_raw);
24753 __tmp.put_u16_le(self.chan6_raw);
24754 __tmp.put_u16_le(self.chan7_raw);
24755 __tmp.put_u16_le(self.chan8_raw);
24756 __tmp.put_u16_le(self.chan9_raw);
24757 __tmp.put_u16_le(self.chan10_raw);
24758 __tmp.put_u16_le(self.chan11_raw);
24759 __tmp.put_u16_le(self.chan12_raw);
24760 __tmp.put_u16_le(self.chan13_raw);
24761 __tmp.put_u16_le(self.chan14_raw);
24762 __tmp.put_u16_le(self.chan15_raw);
24763 __tmp.put_u16_le(self.chan16_raw);
24764 __tmp.put_u16_le(self.chan17_raw);
24765 __tmp.put_u16_le(self.chan18_raw);
24766 __tmp.put_u8(self.chancount);
24767 __tmp.put_u8(self.rssi);
24768 if matches!(version, MavlinkVersion::V2) {
24769 let len = __tmp.len();
24770 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24771 } else {
24772 __tmp.len()
24773 }
24774 }
24775}
24776#[doc = "id: 70"]
24777#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
24778#[derive(Debug, Clone, PartialEq)]
24779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24781pub struct RC_CHANNELS_OVERRIDE_DATA {
24782 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24783 pub chan1_raw: u16,
24784 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24785 pub chan2_raw: u16,
24786 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24787 pub chan3_raw: u16,
24788 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24789 pub chan4_raw: u16,
24790 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24791 pub chan5_raw: u16,
24792 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24793 pub chan6_raw: u16,
24794 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24795 pub chan7_raw: u16,
24796 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24797 pub chan8_raw: u16,
24798 #[doc = "System ID"]
24799 pub target_system: u8,
24800 #[doc = "Component ID"]
24801 pub target_component: u8,
24802 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24803 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24804 pub chan9_raw: u16,
24805 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24806 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24807 pub chan10_raw: u16,
24808 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24809 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24810 pub chan11_raw: u16,
24811 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24812 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24813 pub chan12_raw: u16,
24814 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24815 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24816 pub chan13_raw: u16,
24817 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24818 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24819 pub chan14_raw: u16,
24820 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24821 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24822 pub chan15_raw: u16,
24823 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24824 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24825 pub chan16_raw: u16,
24826 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24827 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24828 pub chan17_raw: u16,
24829 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24830 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24831 pub chan18_raw: u16,
24832}
24833impl RC_CHANNELS_OVERRIDE_DATA {
24834 pub const ENCODED_LEN: usize = 38usize;
24835 pub const DEFAULT: Self = Self {
24836 chan1_raw: 0_u16,
24837 chan2_raw: 0_u16,
24838 chan3_raw: 0_u16,
24839 chan4_raw: 0_u16,
24840 chan5_raw: 0_u16,
24841 chan6_raw: 0_u16,
24842 chan7_raw: 0_u16,
24843 chan8_raw: 0_u16,
24844 target_system: 0_u8,
24845 target_component: 0_u8,
24846 chan9_raw: 0_u16,
24847 chan10_raw: 0_u16,
24848 chan11_raw: 0_u16,
24849 chan12_raw: 0_u16,
24850 chan13_raw: 0_u16,
24851 chan14_raw: 0_u16,
24852 chan15_raw: 0_u16,
24853 chan16_raw: 0_u16,
24854 chan17_raw: 0_u16,
24855 chan18_raw: 0_u16,
24856 };
24857 #[cfg(feature = "arbitrary")]
24858 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24859 use arbitrary::{Arbitrary, Unstructured};
24860 let mut buf = [0u8; 1024];
24861 rng.fill_bytes(&mut buf);
24862 let mut unstructured = Unstructured::new(&buf);
24863 Self::arbitrary(&mut unstructured).unwrap_or_default()
24864 }
24865}
24866impl Default for RC_CHANNELS_OVERRIDE_DATA {
24867 fn default() -> Self {
24868 Self::DEFAULT.clone()
24869 }
24870}
24871impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
24872 type Message = MavMessage;
24873 const ID: u32 = 70u32;
24874 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
24875 const EXTRA_CRC: u8 = 124u8;
24876 const ENCODED_LEN: usize = 38usize;
24877 fn deser(
24878 _version: MavlinkVersion,
24879 __input: &[u8],
24880 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24881 let avail_len = __input.len();
24882 let mut payload_buf = [0; Self::ENCODED_LEN];
24883 let mut buf = if avail_len < Self::ENCODED_LEN {
24884 payload_buf[0..avail_len].copy_from_slice(__input);
24885 Bytes::new(&payload_buf)
24886 } else {
24887 Bytes::new(__input)
24888 };
24889 let mut __struct = Self::default();
24890 __struct.chan1_raw = buf.get_u16_le();
24891 __struct.chan2_raw = buf.get_u16_le();
24892 __struct.chan3_raw = buf.get_u16_le();
24893 __struct.chan4_raw = buf.get_u16_le();
24894 __struct.chan5_raw = buf.get_u16_le();
24895 __struct.chan6_raw = buf.get_u16_le();
24896 __struct.chan7_raw = buf.get_u16_le();
24897 __struct.chan8_raw = buf.get_u16_le();
24898 __struct.target_system = buf.get_u8();
24899 __struct.target_component = buf.get_u8();
24900 __struct.chan9_raw = buf.get_u16_le();
24901 __struct.chan10_raw = buf.get_u16_le();
24902 __struct.chan11_raw = buf.get_u16_le();
24903 __struct.chan12_raw = buf.get_u16_le();
24904 __struct.chan13_raw = buf.get_u16_le();
24905 __struct.chan14_raw = buf.get_u16_le();
24906 __struct.chan15_raw = buf.get_u16_le();
24907 __struct.chan16_raw = buf.get_u16_le();
24908 __struct.chan17_raw = buf.get_u16_le();
24909 __struct.chan18_raw = buf.get_u16_le();
24910 Ok(__struct)
24911 }
24912 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24913 let mut __tmp = BytesMut::new(bytes);
24914 #[allow(clippy::absurd_extreme_comparisons)]
24915 #[allow(unused_comparisons)]
24916 if __tmp.remaining() < Self::ENCODED_LEN {
24917 panic!(
24918 "buffer is too small (need {} bytes, but got {})",
24919 Self::ENCODED_LEN,
24920 __tmp.remaining(),
24921 )
24922 }
24923 __tmp.put_u16_le(self.chan1_raw);
24924 __tmp.put_u16_le(self.chan2_raw);
24925 __tmp.put_u16_le(self.chan3_raw);
24926 __tmp.put_u16_le(self.chan4_raw);
24927 __tmp.put_u16_le(self.chan5_raw);
24928 __tmp.put_u16_le(self.chan6_raw);
24929 __tmp.put_u16_le(self.chan7_raw);
24930 __tmp.put_u16_le(self.chan8_raw);
24931 __tmp.put_u8(self.target_system);
24932 __tmp.put_u8(self.target_component);
24933 __tmp.put_u16_le(self.chan9_raw);
24934 __tmp.put_u16_le(self.chan10_raw);
24935 __tmp.put_u16_le(self.chan11_raw);
24936 __tmp.put_u16_le(self.chan12_raw);
24937 __tmp.put_u16_le(self.chan13_raw);
24938 __tmp.put_u16_le(self.chan14_raw);
24939 __tmp.put_u16_le(self.chan15_raw);
24940 __tmp.put_u16_le(self.chan16_raw);
24941 __tmp.put_u16_le(self.chan17_raw);
24942 __tmp.put_u16_le(self.chan18_raw);
24943 if matches!(version, MavlinkVersion::V2) {
24944 let len = __tmp.len();
24945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24946 } else {
24947 __tmp.len()
24948 }
24949 }
24950}
24951#[doc = "id: 35"]
24952#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24953#[derive(Debug, Clone, PartialEq)]
24954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24956pub struct RC_CHANNELS_RAW_DATA {
24957 #[doc = "Timestamp (time since system boot)."]
24958 pub time_boot_ms: u32,
24959 #[doc = "RC channel 1 value."]
24960 pub chan1_raw: u16,
24961 #[doc = "RC channel 2 value."]
24962 pub chan2_raw: u16,
24963 #[doc = "RC channel 3 value."]
24964 pub chan3_raw: u16,
24965 #[doc = "RC channel 4 value."]
24966 pub chan4_raw: u16,
24967 #[doc = "RC channel 5 value."]
24968 pub chan5_raw: u16,
24969 #[doc = "RC channel 6 value."]
24970 pub chan6_raw: u16,
24971 #[doc = "RC channel 7 value."]
24972 pub chan7_raw: u16,
24973 #[doc = "RC channel 8 value."]
24974 pub chan8_raw: u16,
24975 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24976 pub port: u8,
24977 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24978 pub rssi: u8,
24979}
24980impl RC_CHANNELS_RAW_DATA {
24981 pub const ENCODED_LEN: usize = 22usize;
24982 pub const DEFAULT: Self = Self {
24983 time_boot_ms: 0_u32,
24984 chan1_raw: 0_u16,
24985 chan2_raw: 0_u16,
24986 chan3_raw: 0_u16,
24987 chan4_raw: 0_u16,
24988 chan5_raw: 0_u16,
24989 chan6_raw: 0_u16,
24990 chan7_raw: 0_u16,
24991 chan8_raw: 0_u16,
24992 port: 0_u8,
24993 rssi: 0_u8,
24994 };
24995 #[cfg(feature = "arbitrary")]
24996 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24997 use arbitrary::{Arbitrary, Unstructured};
24998 let mut buf = [0u8; 1024];
24999 rng.fill_bytes(&mut buf);
25000 let mut unstructured = Unstructured::new(&buf);
25001 Self::arbitrary(&mut unstructured).unwrap_or_default()
25002 }
25003}
25004impl Default for RC_CHANNELS_RAW_DATA {
25005 fn default() -> Self {
25006 Self::DEFAULT.clone()
25007 }
25008}
25009impl MessageData for RC_CHANNELS_RAW_DATA {
25010 type Message = MavMessage;
25011 const ID: u32 = 35u32;
25012 const NAME: &'static str = "RC_CHANNELS_RAW";
25013 const EXTRA_CRC: u8 = 244u8;
25014 const ENCODED_LEN: usize = 22usize;
25015 fn deser(
25016 _version: MavlinkVersion,
25017 __input: &[u8],
25018 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25019 let avail_len = __input.len();
25020 let mut payload_buf = [0; Self::ENCODED_LEN];
25021 let mut buf = if avail_len < Self::ENCODED_LEN {
25022 payload_buf[0..avail_len].copy_from_slice(__input);
25023 Bytes::new(&payload_buf)
25024 } else {
25025 Bytes::new(__input)
25026 };
25027 let mut __struct = Self::default();
25028 __struct.time_boot_ms = buf.get_u32_le();
25029 __struct.chan1_raw = buf.get_u16_le();
25030 __struct.chan2_raw = buf.get_u16_le();
25031 __struct.chan3_raw = buf.get_u16_le();
25032 __struct.chan4_raw = buf.get_u16_le();
25033 __struct.chan5_raw = buf.get_u16_le();
25034 __struct.chan6_raw = buf.get_u16_le();
25035 __struct.chan7_raw = buf.get_u16_le();
25036 __struct.chan8_raw = buf.get_u16_le();
25037 __struct.port = buf.get_u8();
25038 __struct.rssi = buf.get_u8();
25039 Ok(__struct)
25040 }
25041 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25042 let mut __tmp = BytesMut::new(bytes);
25043 #[allow(clippy::absurd_extreme_comparisons)]
25044 #[allow(unused_comparisons)]
25045 if __tmp.remaining() < Self::ENCODED_LEN {
25046 panic!(
25047 "buffer is too small (need {} bytes, but got {})",
25048 Self::ENCODED_LEN,
25049 __tmp.remaining(),
25050 )
25051 }
25052 __tmp.put_u32_le(self.time_boot_ms);
25053 __tmp.put_u16_le(self.chan1_raw);
25054 __tmp.put_u16_le(self.chan2_raw);
25055 __tmp.put_u16_le(self.chan3_raw);
25056 __tmp.put_u16_le(self.chan4_raw);
25057 __tmp.put_u16_le(self.chan5_raw);
25058 __tmp.put_u16_le(self.chan6_raw);
25059 __tmp.put_u16_le(self.chan7_raw);
25060 __tmp.put_u16_le(self.chan8_raw);
25061 __tmp.put_u8(self.port);
25062 __tmp.put_u8(self.rssi);
25063 if matches!(version, MavlinkVersion::V2) {
25064 let len = __tmp.len();
25065 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25066 } else {
25067 __tmp.len()
25068 }
25069 }
25070}
25071#[doc = "id: 34"]
25072#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25073#[derive(Debug, Clone, PartialEq)]
25074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25076pub struct RC_CHANNELS_SCALED_DATA {
25077 #[doc = "Timestamp (time since system boot)."]
25078 pub time_boot_ms: u32,
25079 #[doc = "RC channel 1 value scaled."]
25080 pub chan1_scaled: i16,
25081 #[doc = "RC channel 2 value scaled."]
25082 pub chan2_scaled: i16,
25083 #[doc = "RC channel 3 value scaled."]
25084 pub chan3_scaled: i16,
25085 #[doc = "RC channel 4 value scaled."]
25086 pub chan4_scaled: i16,
25087 #[doc = "RC channel 5 value scaled."]
25088 pub chan5_scaled: i16,
25089 #[doc = "RC channel 6 value scaled."]
25090 pub chan6_scaled: i16,
25091 #[doc = "RC channel 7 value scaled."]
25092 pub chan7_scaled: i16,
25093 #[doc = "RC channel 8 value scaled."]
25094 pub chan8_scaled: i16,
25095 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25096 pub port: u8,
25097 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25098 pub rssi: u8,
25099}
25100impl RC_CHANNELS_SCALED_DATA {
25101 pub const ENCODED_LEN: usize = 22usize;
25102 pub const DEFAULT: Self = Self {
25103 time_boot_ms: 0_u32,
25104 chan1_scaled: 0_i16,
25105 chan2_scaled: 0_i16,
25106 chan3_scaled: 0_i16,
25107 chan4_scaled: 0_i16,
25108 chan5_scaled: 0_i16,
25109 chan6_scaled: 0_i16,
25110 chan7_scaled: 0_i16,
25111 chan8_scaled: 0_i16,
25112 port: 0_u8,
25113 rssi: 0_u8,
25114 };
25115 #[cfg(feature = "arbitrary")]
25116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25117 use arbitrary::{Arbitrary, Unstructured};
25118 let mut buf = [0u8; 1024];
25119 rng.fill_bytes(&mut buf);
25120 let mut unstructured = Unstructured::new(&buf);
25121 Self::arbitrary(&mut unstructured).unwrap_or_default()
25122 }
25123}
25124impl Default for RC_CHANNELS_SCALED_DATA {
25125 fn default() -> Self {
25126 Self::DEFAULT.clone()
25127 }
25128}
25129impl MessageData for RC_CHANNELS_SCALED_DATA {
25130 type Message = MavMessage;
25131 const ID: u32 = 34u32;
25132 const NAME: &'static str = "RC_CHANNELS_SCALED";
25133 const EXTRA_CRC: u8 = 237u8;
25134 const ENCODED_LEN: usize = 22usize;
25135 fn deser(
25136 _version: MavlinkVersion,
25137 __input: &[u8],
25138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25139 let avail_len = __input.len();
25140 let mut payload_buf = [0; Self::ENCODED_LEN];
25141 let mut buf = if avail_len < Self::ENCODED_LEN {
25142 payload_buf[0..avail_len].copy_from_slice(__input);
25143 Bytes::new(&payload_buf)
25144 } else {
25145 Bytes::new(__input)
25146 };
25147 let mut __struct = Self::default();
25148 __struct.time_boot_ms = buf.get_u32_le();
25149 __struct.chan1_scaled = buf.get_i16_le();
25150 __struct.chan2_scaled = buf.get_i16_le();
25151 __struct.chan3_scaled = buf.get_i16_le();
25152 __struct.chan4_scaled = buf.get_i16_le();
25153 __struct.chan5_scaled = buf.get_i16_le();
25154 __struct.chan6_scaled = buf.get_i16_le();
25155 __struct.chan7_scaled = buf.get_i16_le();
25156 __struct.chan8_scaled = buf.get_i16_le();
25157 __struct.port = buf.get_u8();
25158 __struct.rssi = buf.get_u8();
25159 Ok(__struct)
25160 }
25161 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25162 let mut __tmp = BytesMut::new(bytes);
25163 #[allow(clippy::absurd_extreme_comparisons)]
25164 #[allow(unused_comparisons)]
25165 if __tmp.remaining() < Self::ENCODED_LEN {
25166 panic!(
25167 "buffer is too small (need {} bytes, but got {})",
25168 Self::ENCODED_LEN,
25169 __tmp.remaining(),
25170 )
25171 }
25172 __tmp.put_u32_le(self.time_boot_ms);
25173 __tmp.put_i16_le(self.chan1_scaled);
25174 __tmp.put_i16_le(self.chan2_scaled);
25175 __tmp.put_i16_le(self.chan3_scaled);
25176 __tmp.put_i16_le(self.chan4_scaled);
25177 __tmp.put_i16_le(self.chan5_scaled);
25178 __tmp.put_i16_le(self.chan6_scaled);
25179 __tmp.put_i16_le(self.chan7_scaled);
25180 __tmp.put_i16_le(self.chan8_scaled);
25181 __tmp.put_u8(self.port);
25182 __tmp.put_u8(self.rssi);
25183 if matches!(version, MavlinkVersion::V2) {
25184 let len = __tmp.len();
25185 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25186 } else {
25187 __tmp.len()
25188 }
25189 }
25190}
25191#[doc = "id: 66"]
25192#[doc = "Request a data stream."]
25193#[derive(Debug, Clone, PartialEq)]
25194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25196pub struct REQUEST_DATA_STREAM_DATA {
25197 #[doc = "The requested message rate"]
25198 pub req_message_rate: u16,
25199 #[doc = "The target requested to send the message stream."]
25200 pub target_system: u8,
25201 #[doc = "The target requested to send the message stream."]
25202 pub target_component: u8,
25203 #[doc = "The ID of the requested data stream"]
25204 pub req_stream_id: u8,
25205 #[doc = "1 to start sending, 0 to stop sending."]
25206 pub start_stop: u8,
25207}
25208impl REQUEST_DATA_STREAM_DATA {
25209 pub const ENCODED_LEN: usize = 6usize;
25210 pub const DEFAULT: Self = Self {
25211 req_message_rate: 0_u16,
25212 target_system: 0_u8,
25213 target_component: 0_u8,
25214 req_stream_id: 0_u8,
25215 start_stop: 0_u8,
25216 };
25217 #[cfg(feature = "arbitrary")]
25218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25219 use arbitrary::{Arbitrary, Unstructured};
25220 let mut buf = [0u8; 1024];
25221 rng.fill_bytes(&mut buf);
25222 let mut unstructured = Unstructured::new(&buf);
25223 Self::arbitrary(&mut unstructured).unwrap_or_default()
25224 }
25225}
25226impl Default for REQUEST_DATA_STREAM_DATA {
25227 fn default() -> Self {
25228 Self::DEFAULT.clone()
25229 }
25230}
25231impl MessageData for REQUEST_DATA_STREAM_DATA {
25232 type Message = MavMessage;
25233 const ID: u32 = 66u32;
25234 const NAME: &'static str = "REQUEST_DATA_STREAM";
25235 const EXTRA_CRC: u8 = 148u8;
25236 const ENCODED_LEN: usize = 6usize;
25237 fn deser(
25238 _version: MavlinkVersion,
25239 __input: &[u8],
25240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25241 let avail_len = __input.len();
25242 let mut payload_buf = [0; Self::ENCODED_LEN];
25243 let mut buf = if avail_len < Self::ENCODED_LEN {
25244 payload_buf[0..avail_len].copy_from_slice(__input);
25245 Bytes::new(&payload_buf)
25246 } else {
25247 Bytes::new(__input)
25248 };
25249 let mut __struct = Self::default();
25250 __struct.req_message_rate = buf.get_u16_le();
25251 __struct.target_system = buf.get_u8();
25252 __struct.target_component = buf.get_u8();
25253 __struct.req_stream_id = buf.get_u8();
25254 __struct.start_stop = buf.get_u8();
25255 Ok(__struct)
25256 }
25257 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25258 let mut __tmp = BytesMut::new(bytes);
25259 #[allow(clippy::absurd_extreme_comparisons)]
25260 #[allow(unused_comparisons)]
25261 if __tmp.remaining() < Self::ENCODED_LEN {
25262 panic!(
25263 "buffer is too small (need {} bytes, but got {})",
25264 Self::ENCODED_LEN,
25265 __tmp.remaining(),
25266 )
25267 }
25268 __tmp.put_u16_le(self.req_message_rate);
25269 __tmp.put_u8(self.target_system);
25270 __tmp.put_u8(self.target_component);
25271 __tmp.put_u8(self.req_stream_id);
25272 __tmp.put_u8(self.start_stop);
25273 if matches!(version, MavlinkVersion::V2) {
25274 let len = __tmp.len();
25275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25276 } else {
25277 __tmp.len()
25278 }
25279 }
25280}
25281#[doc = "id: 412"]
25282#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25283#[derive(Debug, Clone, PartialEq)]
25284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25286pub struct REQUEST_EVENT_DATA {
25287 #[doc = "First sequence number of the requested event."]
25288 pub first_sequence: u16,
25289 #[doc = "Last sequence number of the requested event."]
25290 pub last_sequence: u16,
25291 #[doc = "System ID"]
25292 pub target_system: u8,
25293 #[doc = "Component ID"]
25294 pub target_component: u8,
25295}
25296impl REQUEST_EVENT_DATA {
25297 pub const ENCODED_LEN: usize = 6usize;
25298 pub const DEFAULT: Self = Self {
25299 first_sequence: 0_u16,
25300 last_sequence: 0_u16,
25301 target_system: 0_u8,
25302 target_component: 0_u8,
25303 };
25304 #[cfg(feature = "arbitrary")]
25305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25306 use arbitrary::{Arbitrary, Unstructured};
25307 let mut buf = [0u8; 1024];
25308 rng.fill_bytes(&mut buf);
25309 let mut unstructured = Unstructured::new(&buf);
25310 Self::arbitrary(&mut unstructured).unwrap_or_default()
25311 }
25312}
25313impl Default for REQUEST_EVENT_DATA {
25314 fn default() -> Self {
25315 Self::DEFAULT.clone()
25316 }
25317}
25318impl MessageData for REQUEST_EVENT_DATA {
25319 type Message = MavMessage;
25320 const ID: u32 = 412u32;
25321 const NAME: &'static str = "REQUEST_EVENT";
25322 const EXTRA_CRC: u8 = 33u8;
25323 const ENCODED_LEN: usize = 6usize;
25324 fn deser(
25325 _version: MavlinkVersion,
25326 __input: &[u8],
25327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25328 let avail_len = __input.len();
25329 let mut payload_buf = [0; Self::ENCODED_LEN];
25330 let mut buf = if avail_len < Self::ENCODED_LEN {
25331 payload_buf[0..avail_len].copy_from_slice(__input);
25332 Bytes::new(&payload_buf)
25333 } else {
25334 Bytes::new(__input)
25335 };
25336 let mut __struct = Self::default();
25337 __struct.first_sequence = buf.get_u16_le();
25338 __struct.last_sequence = buf.get_u16_le();
25339 __struct.target_system = buf.get_u8();
25340 __struct.target_component = buf.get_u8();
25341 Ok(__struct)
25342 }
25343 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25344 let mut __tmp = BytesMut::new(bytes);
25345 #[allow(clippy::absurd_extreme_comparisons)]
25346 #[allow(unused_comparisons)]
25347 if __tmp.remaining() < Self::ENCODED_LEN {
25348 panic!(
25349 "buffer is too small (need {} bytes, but got {})",
25350 Self::ENCODED_LEN,
25351 __tmp.remaining(),
25352 )
25353 }
25354 __tmp.put_u16_le(self.first_sequence);
25355 __tmp.put_u16_le(self.last_sequence);
25356 __tmp.put_u8(self.target_system);
25357 __tmp.put_u8(self.target_component);
25358 if matches!(version, MavlinkVersion::V2) {
25359 let len = __tmp.len();
25360 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25361 } else {
25362 __tmp.len()
25363 }
25364 }
25365}
25366#[doc = "id: 142"]
25367#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25368#[derive(Debug, Clone, PartialEq)]
25369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25371pub struct RESOURCE_REQUEST_DATA {
25372 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25373 pub request_id: u8,
25374 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25375 pub uri_type: u8,
25376 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25377 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25378 pub uri: [u8; 120],
25379 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25380 pub transfer_type: u8,
25381 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25382 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25383 pub storage: [u8; 120],
25384}
25385impl RESOURCE_REQUEST_DATA {
25386 pub const ENCODED_LEN: usize = 243usize;
25387 pub const DEFAULT: Self = Self {
25388 request_id: 0_u8,
25389 uri_type: 0_u8,
25390 uri: [0_u8; 120usize],
25391 transfer_type: 0_u8,
25392 storage: [0_u8; 120usize],
25393 };
25394 #[cfg(feature = "arbitrary")]
25395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25396 use arbitrary::{Arbitrary, Unstructured};
25397 let mut buf = [0u8; 1024];
25398 rng.fill_bytes(&mut buf);
25399 let mut unstructured = Unstructured::new(&buf);
25400 Self::arbitrary(&mut unstructured).unwrap_or_default()
25401 }
25402}
25403impl Default for RESOURCE_REQUEST_DATA {
25404 fn default() -> Self {
25405 Self::DEFAULT.clone()
25406 }
25407}
25408impl MessageData for RESOURCE_REQUEST_DATA {
25409 type Message = MavMessage;
25410 const ID: u32 = 142u32;
25411 const NAME: &'static str = "RESOURCE_REQUEST";
25412 const EXTRA_CRC: u8 = 72u8;
25413 const ENCODED_LEN: usize = 243usize;
25414 fn deser(
25415 _version: MavlinkVersion,
25416 __input: &[u8],
25417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25418 let avail_len = __input.len();
25419 let mut payload_buf = [0; Self::ENCODED_LEN];
25420 let mut buf = if avail_len < Self::ENCODED_LEN {
25421 payload_buf[0..avail_len].copy_from_slice(__input);
25422 Bytes::new(&payload_buf)
25423 } else {
25424 Bytes::new(__input)
25425 };
25426 let mut __struct = Self::default();
25427 __struct.request_id = buf.get_u8();
25428 __struct.uri_type = buf.get_u8();
25429 for v in &mut __struct.uri {
25430 let val = buf.get_u8();
25431 *v = val;
25432 }
25433 __struct.transfer_type = buf.get_u8();
25434 for v in &mut __struct.storage {
25435 let val = buf.get_u8();
25436 *v = val;
25437 }
25438 Ok(__struct)
25439 }
25440 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25441 let mut __tmp = BytesMut::new(bytes);
25442 #[allow(clippy::absurd_extreme_comparisons)]
25443 #[allow(unused_comparisons)]
25444 if __tmp.remaining() < Self::ENCODED_LEN {
25445 panic!(
25446 "buffer is too small (need {} bytes, but got {})",
25447 Self::ENCODED_LEN,
25448 __tmp.remaining(),
25449 )
25450 }
25451 __tmp.put_u8(self.request_id);
25452 __tmp.put_u8(self.uri_type);
25453 for val in &self.uri {
25454 __tmp.put_u8(*val);
25455 }
25456 __tmp.put_u8(self.transfer_type);
25457 for val in &self.storage {
25458 __tmp.put_u8(*val);
25459 }
25460 if matches!(version, MavlinkVersion::V2) {
25461 let len = __tmp.len();
25462 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25463 } else {
25464 __tmp.len()
25465 }
25466 }
25467}
25468#[doc = "id: 413"]
25469#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25470#[derive(Debug, Clone, PartialEq)]
25471#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25472#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25473pub struct RESPONSE_EVENT_ERROR_DATA {
25474 #[doc = "Sequence number."]
25475 pub sequence: u16,
25476 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25477 pub sequence_oldest_available: u16,
25478 #[doc = "System ID"]
25479 pub target_system: u8,
25480 #[doc = "Component ID"]
25481 pub target_component: u8,
25482 #[doc = "Error reason."]
25483 pub reason: MavEventErrorReason,
25484}
25485impl RESPONSE_EVENT_ERROR_DATA {
25486 pub const ENCODED_LEN: usize = 7usize;
25487 pub const DEFAULT: Self = Self {
25488 sequence: 0_u16,
25489 sequence_oldest_available: 0_u16,
25490 target_system: 0_u8,
25491 target_component: 0_u8,
25492 reason: MavEventErrorReason::DEFAULT,
25493 };
25494 #[cfg(feature = "arbitrary")]
25495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25496 use arbitrary::{Arbitrary, Unstructured};
25497 let mut buf = [0u8; 1024];
25498 rng.fill_bytes(&mut buf);
25499 let mut unstructured = Unstructured::new(&buf);
25500 Self::arbitrary(&mut unstructured).unwrap_or_default()
25501 }
25502}
25503impl Default for RESPONSE_EVENT_ERROR_DATA {
25504 fn default() -> Self {
25505 Self::DEFAULT.clone()
25506 }
25507}
25508impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25509 type Message = MavMessage;
25510 const ID: u32 = 413u32;
25511 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25512 const EXTRA_CRC: u8 = 77u8;
25513 const ENCODED_LEN: usize = 7usize;
25514 fn deser(
25515 _version: MavlinkVersion,
25516 __input: &[u8],
25517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25518 let avail_len = __input.len();
25519 let mut payload_buf = [0; Self::ENCODED_LEN];
25520 let mut buf = if avail_len < Self::ENCODED_LEN {
25521 payload_buf[0..avail_len].copy_from_slice(__input);
25522 Bytes::new(&payload_buf)
25523 } else {
25524 Bytes::new(__input)
25525 };
25526 let mut __struct = Self::default();
25527 __struct.sequence = buf.get_u16_le();
25528 __struct.sequence_oldest_available = buf.get_u16_le();
25529 __struct.target_system = buf.get_u8();
25530 __struct.target_component = buf.get_u8();
25531 let tmp = buf.get_u8();
25532 __struct.reason =
25533 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25534 enum_type: "MavEventErrorReason",
25535 value: tmp as u32,
25536 })?;
25537 Ok(__struct)
25538 }
25539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25540 let mut __tmp = BytesMut::new(bytes);
25541 #[allow(clippy::absurd_extreme_comparisons)]
25542 #[allow(unused_comparisons)]
25543 if __tmp.remaining() < Self::ENCODED_LEN {
25544 panic!(
25545 "buffer is too small (need {} bytes, but got {})",
25546 Self::ENCODED_LEN,
25547 __tmp.remaining(),
25548 )
25549 }
25550 __tmp.put_u16_le(self.sequence);
25551 __tmp.put_u16_le(self.sequence_oldest_available);
25552 __tmp.put_u8(self.target_system);
25553 __tmp.put_u8(self.target_component);
25554 __tmp.put_u8(self.reason as u8);
25555 if matches!(version, MavlinkVersion::V2) {
25556 let len = __tmp.len();
25557 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25558 } else {
25559 __tmp.len()
25560 }
25561 }
25562}
25563#[doc = "id: 55"]
25564#[doc = "Read out the safety zone the MAV currently assumes."]
25565#[derive(Debug, Clone, PartialEq)]
25566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25568pub struct SAFETY_ALLOWED_AREA_DATA {
25569 #[doc = "x position 1 / Latitude 1"]
25570 pub p1x: f32,
25571 #[doc = "y position 1 / Longitude 1"]
25572 pub p1y: f32,
25573 #[doc = "z position 1 / Altitude 1"]
25574 pub p1z: f32,
25575 #[doc = "x position 2 / Latitude 2"]
25576 pub p2x: f32,
25577 #[doc = "y position 2 / Longitude 2"]
25578 pub p2y: f32,
25579 #[doc = "z position 2 / Altitude 2"]
25580 pub p2z: f32,
25581 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25582 pub frame: MavFrame,
25583}
25584impl SAFETY_ALLOWED_AREA_DATA {
25585 pub const ENCODED_LEN: usize = 25usize;
25586 pub const DEFAULT: Self = Self {
25587 p1x: 0.0_f32,
25588 p1y: 0.0_f32,
25589 p1z: 0.0_f32,
25590 p2x: 0.0_f32,
25591 p2y: 0.0_f32,
25592 p2z: 0.0_f32,
25593 frame: MavFrame::DEFAULT,
25594 };
25595 #[cfg(feature = "arbitrary")]
25596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25597 use arbitrary::{Arbitrary, Unstructured};
25598 let mut buf = [0u8; 1024];
25599 rng.fill_bytes(&mut buf);
25600 let mut unstructured = Unstructured::new(&buf);
25601 Self::arbitrary(&mut unstructured).unwrap_or_default()
25602 }
25603}
25604impl Default for SAFETY_ALLOWED_AREA_DATA {
25605 fn default() -> Self {
25606 Self::DEFAULT.clone()
25607 }
25608}
25609impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25610 type Message = MavMessage;
25611 const ID: u32 = 55u32;
25612 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25613 const EXTRA_CRC: u8 = 3u8;
25614 const ENCODED_LEN: usize = 25usize;
25615 fn deser(
25616 _version: MavlinkVersion,
25617 __input: &[u8],
25618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25619 let avail_len = __input.len();
25620 let mut payload_buf = [0; Self::ENCODED_LEN];
25621 let mut buf = if avail_len < Self::ENCODED_LEN {
25622 payload_buf[0..avail_len].copy_from_slice(__input);
25623 Bytes::new(&payload_buf)
25624 } else {
25625 Bytes::new(__input)
25626 };
25627 let mut __struct = Self::default();
25628 __struct.p1x = buf.get_f32_le();
25629 __struct.p1y = buf.get_f32_le();
25630 __struct.p1z = buf.get_f32_le();
25631 __struct.p2x = buf.get_f32_le();
25632 __struct.p2y = buf.get_f32_le();
25633 __struct.p2z = buf.get_f32_le();
25634 let tmp = buf.get_u8();
25635 __struct.frame =
25636 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25637 enum_type: "MavFrame",
25638 value: tmp as u32,
25639 })?;
25640 Ok(__struct)
25641 }
25642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25643 let mut __tmp = BytesMut::new(bytes);
25644 #[allow(clippy::absurd_extreme_comparisons)]
25645 #[allow(unused_comparisons)]
25646 if __tmp.remaining() < Self::ENCODED_LEN {
25647 panic!(
25648 "buffer is too small (need {} bytes, but got {})",
25649 Self::ENCODED_LEN,
25650 __tmp.remaining(),
25651 )
25652 }
25653 __tmp.put_f32_le(self.p1x);
25654 __tmp.put_f32_le(self.p1y);
25655 __tmp.put_f32_le(self.p1z);
25656 __tmp.put_f32_le(self.p2x);
25657 __tmp.put_f32_le(self.p2y);
25658 __tmp.put_f32_le(self.p2z);
25659 __tmp.put_u8(self.frame as u8);
25660 if matches!(version, MavlinkVersion::V2) {
25661 let len = __tmp.len();
25662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25663 } else {
25664 __tmp.len()
25665 }
25666 }
25667}
25668#[doc = "id: 54"]
25669#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
25670#[derive(Debug, Clone, PartialEq)]
25671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25673pub struct SAFETY_SET_ALLOWED_AREA_DATA {
25674 #[doc = "x position 1 / Latitude 1"]
25675 pub p1x: f32,
25676 #[doc = "y position 1 / Longitude 1"]
25677 pub p1y: f32,
25678 #[doc = "z position 1 / Altitude 1"]
25679 pub p1z: f32,
25680 #[doc = "x position 2 / Latitude 2"]
25681 pub p2x: f32,
25682 #[doc = "y position 2 / Longitude 2"]
25683 pub p2y: f32,
25684 #[doc = "z position 2 / Altitude 2"]
25685 pub p2z: f32,
25686 #[doc = "System ID"]
25687 pub target_system: u8,
25688 #[doc = "Component ID"]
25689 pub target_component: u8,
25690 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25691 pub frame: MavFrame,
25692}
25693impl SAFETY_SET_ALLOWED_AREA_DATA {
25694 pub const ENCODED_LEN: usize = 27usize;
25695 pub const DEFAULT: Self = Self {
25696 p1x: 0.0_f32,
25697 p1y: 0.0_f32,
25698 p1z: 0.0_f32,
25699 p2x: 0.0_f32,
25700 p2y: 0.0_f32,
25701 p2z: 0.0_f32,
25702 target_system: 0_u8,
25703 target_component: 0_u8,
25704 frame: MavFrame::DEFAULT,
25705 };
25706 #[cfg(feature = "arbitrary")]
25707 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25708 use arbitrary::{Arbitrary, Unstructured};
25709 let mut buf = [0u8; 1024];
25710 rng.fill_bytes(&mut buf);
25711 let mut unstructured = Unstructured::new(&buf);
25712 Self::arbitrary(&mut unstructured).unwrap_or_default()
25713 }
25714}
25715impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
25716 fn default() -> Self {
25717 Self::DEFAULT.clone()
25718 }
25719}
25720impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
25721 type Message = MavMessage;
25722 const ID: u32 = 54u32;
25723 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
25724 const EXTRA_CRC: u8 = 15u8;
25725 const ENCODED_LEN: usize = 27usize;
25726 fn deser(
25727 _version: MavlinkVersion,
25728 __input: &[u8],
25729 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25730 let avail_len = __input.len();
25731 let mut payload_buf = [0; Self::ENCODED_LEN];
25732 let mut buf = if avail_len < Self::ENCODED_LEN {
25733 payload_buf[0..avail_len].copy_from_slice(__input);
25734 Bytes::new(&payload_buf)
25735 } else {
25736 Bytes::new(__input)
25737 };
25738 let mut __struct = Self::default();
25739 __struct.p1x = buf.get_f32_le();
25740 __struct.p1y = buf.get_f32_le();
25741 __struct.p1z = buf.get_f32_le();
25742 __struct.p2x = buf.get_f32_le();
25743 __struct.p2y = buf.get_f32_le();
25744 __struct.p2z = buf.get_f32_le();
25745 __struct.target_system = buf.get_u8();
25746 __struct.target_component = buf.get_u8();
25747 let tmp = buf.get_u8();
25748 __struct.frame =
25749 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25750 enum_type: "MavFrame",
25751 value: tmp as u32,
25752 })?;
25753 Ok(__struct)
25754 }
25755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25756 let mut __tmp = BytesMut::new(bytes);
25757 #[allow(clippy::absurd_extreme_comparisons)]
25758 #[allow(unused_comparisons)]
25759 if __tmp.remaining() < Self::ENCODED_LEN {
25760 panic!(
25761 "buffer is too small (need {} bytes, but got {})",
25762 Self::ENCODED_LEN,
25763 __tmp.remaining(),
25764 )
25765 }
25766 __tmp.put_f32_le(self.p1x);
25767 __tmp.put_f32_le(self.p1y);
25768 __tmp.put_f32_le(self.p1z);
25769 __tmp.put_f32_le(self.p2x);
25770 __tmp.put_f32_le(self.p2y);
25771 __tmp.put_f32_le(self.p2z);
25772 __tmp.put_u8(self.target_system);
25773 __tmp.put_u8(self.target_component);
25774 __tmp.put_u8(self.frame as u8);
25775 if matches!(version, MavlinkVersion::V2) {
25776 let len = __tmp.len();
25777 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25778 } else {
25779 __tmp.len()
25780 }
25781 }
25782}
25783#[doc = "id: 26"]
25784#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
25785#[derive(Debug, Clone, PartialEq)]
25786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25788pub struct SCALED_IMU_DATA {
25789 #[doc = "Timestamp (time since system boot)."]
25790 pub time_boot_ms: u32,
25791 #[doc = "X acceleration"]
25792 pub xacc: i16,
25793 #[doc = "Y acceleration"]
25794 pub yacc: i16,
25795 #[doc = "Z acceleration"]
25796 pub zacc: i16,
25797 #[doc = "Angular speed around X axis"]
25798 pub xgyro: i16,
25799 #[doc = "Angular speed around Y axis"]
25800 pub ygyro: i16,
25801 #[doc = "Angular speed around Z axis"]
25802 pub zgyro: i16,
25803 #[doc = "X Magnetic field"]
25804 pub xmag: i16,
25805 #[doc = "Y Magnetic field"]
25806 pub ymag: i16,
25807 #[doc = "Z Magnetic field"]
25808 pub zmag: i16,
25809 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25810 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25811 pub temperature: i16,
25812}
25813impl SCALED_IMU_DATA {
25814 pub const ENCODED_LEN: usize = 24usize;
25815 pub const DEFAULT: Self = Self {
25816 time_boot_ms: 0_u32,
25817 xacc: 0_i16,
25818 yacc: 0_i16,
25819 zacc: 0_i16,
25820 xgyro: 0_i16,
25821 ygyro: 0_i16,
25822 zgyro: 0_i16,
25823 xmag: 0_i16,
25824 ymag: 0_i16,
25825 zmag: 0_i16,
25826 temperature: 0_i16,
25827 };
25828 #[cfg(feature = "arbitrary")]
25829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25830 use arbitrary::{Arbitrary, Unstructured};
25831 let mut buf = [0u8; 1024];
25832 rng.fill_bytes(&mut buf);
25833 let mut unstructured = Unstructured::new(&buf);
25834 Self::arbitrary(&mut unstructured).unwrap_or_default()
25835 }
25836}
25837impl Default for SCALED_IMU_DATA {
25838 fn default() -> Self {
25839 Self::DEFAULT.clone()
25840 }
25841}
25842impl MessageData for SCALED_IMU_DATA {
25843 type Message = MavMessage;
25844 const ID: u32 = 26u32;
25845 const NAME: &'static str = "SCALED_IMU";
25846 const EXTRA_CRC: u8 = 170u8;
25847 const ENCODED_LEN: usize = 24usize;
25848 fn deser(
25849 _version: MavlinkVersion,
25850 __input: &[u8],
25851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25852 let avail_len = __input.len();
25853 let mut payload_buf = [0; Self::ENCODED_LEN];
25854 let mut buf = if avail_len < Self::ENCODED_LEN {
25855 payload_buf[0..avail_len].copy_from_slice(__input);
25856 Bytes::new(&payload_buf)
25857 } else {
25858 Bytes::new(__input)
25859 };
25860 let mut __struct = Self::default();
25861 __struct.time_boot_ms = buf.get_u32_le();
25862 __struct.xacc = buf.get_i16_le();
25863 __struct.yacc = buf.get_i16_le();
25864 __struct.zacc = buf.get_i16_le();
25865 __struct.xgyro = buf.get_i16_le();
25866 __struct.ygyro = buf.get_i16_le();
25867 __struct.zgyro = buf.get_i16_le();
25868 __struct.xmag = buf.get_i16_le();
25869 __struct.ymag = buf.get_i16_le();
25870 __struct.zmag = buf.get_i16_le();
25871 __struct.temperature = buf.get_i16_le();
25872 Ok(__struct)
25873 }
25874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25875 let mut __tmp = BytesMut::new(bytes);
25876 #[allow(clippy::absurd_extreme_comparisons)]
25877 #[allow(unused_comparisons)]
25878 if __tmp.remaining() < Self::ENCODED_LEN {
25879 panic!(
25880 "buffer is too small (need {} bytes, but got {})",
25881 Self::ENCODED_LEN,
25882 __tmp.remaining(),
25883 )
25884 }
25885 __tmp.put_u32_le(self.time_boot_ms);
25886 __tmp.put_i16_le(self.xacc);
25887 __tmp.put_i16_le(self.yacc);
25888 __tmp.put_i16_le(self.zacc);
25889 __tmp.put_i16_le(self.xgyro);
25890 __tmp.put_i16_le(self.ygyro);
25891 __tmp.put_i16_le(self.zgyro);
25892 __tmp.put_i16_le(self.xmag);
25893 __tmp.put_i16_le(self.ymag);
25894 __tmp.put_i16_le(self.zmag);
25895 __tmp.put_i16_le(self.temperature);
25896 if matches!(version, MavlinkVersion::V2) {
25897 let len = __tmp.len();
25898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25899 } else {
25900 __tmp.len()
25901 }
25902 }
25903}
25904#[doc = "id: 116"]
25905#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
25906#[derive(Debug, Clone, PartialEq)]
25907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25909pub struct SCALED_IMU2_DATA {
25910 #[doc = "Timestamp (time since system boot)."]
25911 pub time_boot_ms: u32,
25912 #[doc = "X acceleration"]
25913 pub xacc: i16,
25914 #[doc = "Y acceleration"]
25915 pub yacc: i16,
25916 #[doc = "Z acceleration"]
25917 pub zacc: i16,
25918 #[doc = "Angular speed around X axis"]
25919 pub xgyro: i16,
25920 #[doc = "Angular speed around Y axis"]
25921 pub ygyro: i16,
25922 #[doc = "Angular speed around Z axis"]
25923 pub zgyro: i16,
25924 #[doc = "X Magnetic field"]
25925 pub xmag: i16,
25926 #[doc = "Y Magnetic field"]
25927 pub ymag: i16,
25928 #[doc = "Z Magnetic field"]
25929 pub zmag: i16,
25930 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25932 pub temperature: i16,
25933}
25934impl SCALED_IMU2_DATA {
25935 pub const ENCODED_LEN: usize = 24usize;
25936 pub const DEFAULT: Self = Self {
25937 time_boot_ms: 0_u32,
25938 xacc: 0_i16,
25939 yacc: 0_i16,
25940 zacc: 0_i16,
25941 xgyro: 0_i16,
25942 ygyro: 0_i16,
25943 zgyro: 0_i16,
25944 xmag: 0_i16,
25945 ymag: 0_i16,
25946 zmag: 0_i16,
25947 temperature: 0_i16,
25948 };
25949 #[cfg(feature = "arbitrary")]
25950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25951 use arbitrary::{Arbitrary, Unstructured};
25952 let mut buf = [0u8; 1024];
25953 rng.fill_bytes(&mut buf);
25954 let mut unstructured = Unstructured::new(&buf);
25955 Self::arbitrary(&mut unstructured).unwrap_or_default()
25956 }
25957}
25958impl Default for SCALED_IMU2_DATA {
25959 fn default() -> Self {
25960 Self::DEFAULT.clone()
25961 }
25962}
25963impl MessageData for SCALED_IMU2_DATA {
25964 type Message = MavMessage;
25965 const ID: u32 = 116u32;
25966 const NAME: &'static str = "SCALED_IMU2";
25967 const EXTRA_CRC: u8 = 76u8;
25968 const ENCODED_LEN: usize = 24usize;
25969 fn deser(
25970 _version: MavlinkVersion,
25971 __input: &[u8],
25972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25973 let avail_len = __input.len();
25974 let mut payload_buf = [0; Self::ENCODED_LEN];
25975 let mut buf = if avail_len < Self::ENCODED_LEN {
25976 payload_buf[0..avail_len].copy_from_slice(__input);
25977 Bytes::new(&payload_buf)
25978 } else {
25979 Bytes::new(__input)
25980 };
25981 let mut __struct = Self::default();
25982 __struct.time_boot_ms = buf.get_u32_le();
25983 __struct.xacc = buf.get_i16_le();
25984 __struct.yacc = buf.get_i16_le();
25985 __struct.zacc = buf.get_i16_le();
25986 __struct.xgyro = buf.get_i16_le();
25987 __struct.ygyro = buf.get_i16_le();
25988 __struct.zgyro = buf.get_i16_le();
25989 __struct.xmag = buf.get_i16_le();
25990 __struct.ymag = buf.get_i16_le();
25991 __struct.zmag = buf.get_i16_le();
25992 __struct.temperature = buf.get_i16_le();
25993 Ok(__struct)
25994 }
25995 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25996 let mut __tmp = BytesMut::new(bytes);
25997 #[allow(clippy::absurd_extreme_comparisons)]
25998 #[allow(unused_comparisons)]
25999 if __tmp.remaining() < Self::ENCODED_LEN {
26000 panic!(
26001 "buffer is too small (need {} bytes, but got {})",
26002 Self::ENCODED_LEN,
26003 __tmp.remaining(),
26004 )
26005 }
26006 __tmp.put_u32_le(self.time_boot_ms);
26007 __tmp.put_i16_le(self.xacc);
26008 __tmp.put_i16_le(self.yacc);
26009 __tmp.put_i16_le(self.zacc);
26010 __tmp.put_i16_le(self.xgyro);
26011 __tmp.put_i16_le(self.ygyro);
26012 __tmp.put_i16_le(self.zgyro);
26013 __tmp.put_i16_le(self.xmag);
26014 __tmp.put_i16_le(self.ymag);
26015 __tmp.put_i16_le(self.zmag);
26016 __tmp.put_i16_le(self.temperature);
26017 if matches!(version, MavlinkVersion::V2) {
26018 let len = __tmp.len();
26019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26020 } else {
26021 __tmp.len()
26022 }
26023 }
26024}
26025#[doc = "id: 129"]
26026#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26027#[derive(Debug, Clone, PartialEq)]
26028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26029#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26030pub struct SCALED_IMU3_DATA {
26031 #[doc = "Timestamp (time since system boot)."]
26032 pub time_boot_ms: u32,
26033 #[doc = "X acceleration"]
26034 pub xacc: i16,
26035 #[doc = "Y acceleration"]
26036 pub yacc: i16,
26037 #[doc = "Z acceleration"]
26038 pub zacc: i16,
26039 #[doc = "Angular speed around X axis"]
26040 pub xgyro: i16,
26041 #[doc = "Angular speed around Y axis"]
26042 pub ygyro: i16,
26043 #[doc = "Angular speed around Z axis"]
26044 pub zgyro: i16,
26045 #[doc = "X Magnetic field"]
26046 pub xmag: i16,
26047 #[doc = "Y Magnetic field"]
26048 pub ymag: i16,
26049 #[doc = "Z Magnetic field"]
26050 pub zmag: i16,
26051 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26052 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26053 pub temperature: i16,
26054}
26055impl SCALED_IMU3_DATA {
26056 pub const ENCODED_LEN: usize = 24usize;
26057 pub const DEFAULT: Self = Self {
26058 time_boot_ms: 0_u32,
26059 xacc: 0_i16,
26060 yacc: 0_i16,
26061 zacc: 0_i16,
26062 xgyro: 0_i16,
26063 ygyro: 0_i16,
26064 zgyro: 0_i16,
26065 xmag: 0_i16,
26066 ymag: 0_i16,
26067 zmag: 0_i16,
26068 temperature: 0_i16,
26069 };
26070 #[cfg(feature = "arbitrary")]
26071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26072 use arbitrary::{Arbitrary, Unstructured};
26073 let mut buf = [0u8; 1024];
26074 rng.fill_bytes(&mut buf);
26075 let mut unstructured = Unstructured::new(&buf);
26076 Self::arbitrary(&mut unstructured).unwrap_or_default()
26077 }
26078}
26079impl Default for SCALED_IMU3_DATA {
26080 fn default() -> Self {
26081 Self::DEFAULT.clone()
26082 }
26083}
26084impl MessageData for SCALED_IMU3_DATA {
26085 type Message = MavMessage;
26086 const ID: u32 = 129u32;
26087 const NAME: &'static str = "SCALED_IMU3";
26088 const EXTRA_CRC: u8 = 46u8;
26089 const ENCODED_LEN: usize = 24usize;
26090 fn deser(
26091 _version: MavlinkVersion,
26092 __input: &[u8],
26093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26094 let avail_len = __input.len();
26095 let mut payload_buf = [0; Self::ENCODED_LEN];
26096 let mut buf = if avail_len < Self::ENCODED_LEN {
26097 payload_buf[0..avail_len].copy_from_slice(__input);
26098 Bytes::new(&payload_buf)
26099 } else {
26100 Bytes::new(__input)
26101 };
26102 let mut __struct = Self::default();
26103 __struct.time_boot_ms = buf.get_u32_le();
26104 __struct.xacc = buf.get_i16_le();
26105 __struct.yacc = buf.get_i16_le();
26106 __struct.zacc = buf.get_i16_le();
26107 __struct.xgyro = buf.get_i16_le();
26108 __struct.ygyro = buf.get_i16_le();
26109 __struct.zgyro = buf.get_i16_le();
26110 __struct.xmag = buf.get_i16_le();
26111 __struct.ymag = buf.get_i16_le();
26112 __struct.zmag = buf.get_i16_le();
26113 __struct.temperature = buf.get_i16_le();
26114 Ok(__struct)
26115 }
26116 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26117 let mut __tmp = BytesMut::new(bytes);
26118 #[allow(clippy::absurd_extreme_comparisons)]
26119 #[allow(unused_comparisons)]
26120 if __tmp.remaining() < Self::ENCODED_LEN {
26121 panic!(
26122 "buffer is too small (need {} bytes, but got {})",
26123 Self::ENCODED_LEN,
26124 __tmp.remaining(),
26125 )
26126 }
26127 __tmp.put_u32_le(self.time_boot_ms);
26128 __tmp.put_i16_le(self.xacc);
26129 __tmp.put_i16_le(self.yacc);
26130 __tmp.put_i16_le(self.zacc);
26131 __tmp.put_i16_le(self.xgyro);
26132 __tmp.put_i16_le(self.ygyro);
26133 __tmp.put_i16_le(self.zgyro);
26134 __tmp.put_i16_le(self.xmag);
26135 __tmp.put_i16_le(self.ymag);
26136 __tmp.put_i16_le(self.zmag);
26137 __tmp.put_i16_le(self.temperature);
26138 if matches!(version, MavlinkVersion::V2) {
26139 let len = __tmp.len();
26140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26141 } else {
26142 __tmp.len()
26143 }
26144 }
26145}
26146#[doc = "id: 29"]
26147#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26148#[derive(Debug, Clone, PartialEq)]
26149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26151pub struct SCALED_PRESSURE_DATA {
26152 #[doc = "Timestamp (time since system boot)."]
26153 pub time_boot_ms: u32,
26154 #[doc = "Absolute pressure"]
26155 pub press_abs: f32,
26156 #[doc = "Differential pressure 1"]
26157 pub press_diff: f32,
26158 #[doc = "Absolute pressure temperature"]
26159 pub temperature: i16,
26160 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26161 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26162 pub temperature_press_diff: i16,
26163}
26164impl SCALED_PRESSURE_DATA {
26165 pub const ENCODED_LEN: usize = 16usize;
26166 pub const DEFAULT: Self = Self {
26167 time_boot_ms: 0_u32,
26168 press_abs: 0.0_f32,
26169 press_diff: 0.0_f32,
26170 temperature: 0_i16,
26171 temperature_press_diff: 0_i16,
26172 };
26173 #[cfg(feature = "arbitrary")]
26174 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26175 use arbitrary::{Arbitrary, Unstructured};
26176 let mut buf = [0u8; 1024];
26177 rng.fill_bytes(&mut buf);
26178 let mut unstructured = Unstructured::new(&buf);
26179 Self::arbitrary(&mut unstructured).unwrap_or_default()
26180 }
26181}
26182impl Default for SCALED_PRESSURE_DATA {
26183 fn default() -> Self {
26184 Self::DEFAULT.clone()
26185 }
26186}
26187impl MessageData for SCALED_PRESSURE_DATA {
26188 type Message = MavMessage;
26189 const ID: u32 = 29u32;
26190 const NAME: &'static str = "SCALED_PRESSURE";
26191 const EXTRA_CRC: u8 = 115u8;
26192 const ENCODED_LEN: usize = 16usize;
26193 fn deser(
26194 _version: MavlinkVersion,
26195 __input: &[u8],
26196 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26197 let avail_len = __input.len();
26198 let mut payload_buf = [0; Self::ENCODED_LEN];
26199 let mut buf = if avail_len < Self::ENCODED_LEN {
26200 payload_buf[0..avail_len].copy_from_slice(__input);
26201 Bytes::new(&payload_buf)
26202 } else {
26203 Bytes::new(__input)
26204 };
26205 let mut __struct = Self::default();
26206 __struct.time_boot_ms = buf.get_u32_le();
26207 __struct.press_abs = buf.get_f32_le();
26208 __struct.press_diff = buf.get_f32_le();
26209 __struct.temperature = buf.get_i16_le();
26210 __struct.temperature_press_diff = buf.get_i16_le();
26211 Ok(__struct)
26212 }
26213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26214 let mut __tmp = BytesMut::new(bytes);
26215 #[allow(clippy::absurd_extreme_comparisons)]
26216 #[allow(unused_comparisons)]
26217 if __tmp.remaining() < Self::ENCODED_LEN {
26218 panic!(
26219 "buffer is too small (need {} bytes, but got {})",
26220 Self::ENCODED_LEN,
26221 __tmp.remaining(),
26222 )
26223 }
26224 __tmp.put_u32_le(self.time_boot_ms);
26225 __tmp.put_f32_le(self.press_abs);
26226 __tmp.put_f32_le(self.press_diff);
26227 __tmp.put_i16_le(self.temperature);
26228 __tmp.put_i16_le(self.temperature_press_diff);
26229 if matches!(version, MavlinkVersion::V2) {
26230 let len = __tmp.len();
26231 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26232 } else {
26233 __tmp.len()
26234 }
26235 }
26236}
26237#[doc = "id: 137"]
26238#[doc = "Barometer readings for 2nd barometer."]
26239#[derive(Debug, Clone, PartialEq)]
26240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26242pub struct SCALED_PRESSURE2_DATA {
26243 #[doc = "Timestamp (time since system boot)."]
26244 pub time_boot_ms: u32,
26245 #[doc = "Absolute pressure"]
26246 pub press_abs: f32,
26247 #[doc = "Differential pressure"]
26248 pub press_diff: f32,
26249 #[doc = "Absolute pressure temperature"]
26250 pub temperature: i16,
26251 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26252 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26253 pub temperature_press_diff: i16,
26254}
26255impl SCALED_PRESSURE2_DATA {
26256 pub const ENCODED_LEN: usize = 16usize;
26257 pub const DEFAULT: Self = Self {
26258 time_boot_ms: 0_u32,
26259 press_abs: 0.0_f32,
26260 press_diff: 0.0_f32,
26261 temperature: 0_i16,
26262 temperature_press_diff: 0_i16,
26263 };
26264 #[cfg(feature = "arbitrary")]
26265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26266 use arbitrary::{Arbitrary, Unstructured};
26267 let mut buf = [0u8; 1024];
26268 rng.fill_bytes(&mut buf);
26269 let mut unstructured = Unstructured::new(&buf);
26270 Self::arbitrary(&mut unstructured).unwrap_or_default()
26271 }
26272}
26273impl Default for SCALED_PRESSURE2_DATA {
26274 fn default() -> Self {
26275 Self::DEFAULT.clone()
26276 }
26277}
26278impl MessageData for SCALED_PRESSURE2_DATA {
26279 type Message = MavMessage;
26280 const ID: u32 = 137u32;
26281 const NAME: &'static str = "SCALED_PRESSURE2";
26282 const EXTRA_CRC: u8 = 195u8;
26283 const ENCODED_LEN: usize = 16usize;
26284 fn deser(
26285 _version: MavlinkVersion,
26286 __input: &[u8],
26287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26288 let avail_len = __input.len();
26289 let mut payload_buf = [0; Self::ENCODED_LEN];
26290 let mut buf = if avail_len < Self::ENCODED_LEN {
26291 payload_buf[0..avail_len].copy_from_slice(__input);
26292 Bytes::new(&payload_buf)
26293 } else {
26294 Bytes::new(__input)
26295 };
26296 let mut __struct = Self::default();
26297 __struct.time_boot_ms = buf.get_u32_le();
26298 __struct.press_abs = buf.get_f32_le();
26299 __struct.press_diff = buf.get_f32_le();
26300 __struct.temperature = buf.get_i16_le();
26301 __struct.temperature_press_diff = buf.get_i16_le();
26302 Ok(__struct)
26303 }
26304 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26305 let mut __tmp = BytesMut::new(bytes);
26306 #[allow(clippy::absurd_extreme_comparisons)]
26307 #[allow(unused_comparisons)]
26308 if __tmp.remaining() < Self::ENCODED_LEN {
26309 panic!(
26310 "buffer is too small (need {} bytes, but got {})",
26311 Self::ENCODED_LEN,
26312 __tmp.remaining(),
26313 )
26314 }
26315 __tmp.put_u32_le(self.time_boot_ms);
26316 __tmp.put_f32_le(self.press_abs);
26317 __tmp.put_f32_le(self.press_diff);
26318 __tmp.put_i16_le(self.temperature);
26319 __tmp.put_i16_le(self.temperature_press_diff);
26320 if matches!(version, MavlinkVersion::V2) {
26321 let len = __tmp.len();
26322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26323 } else {
26324 __tmp.len()
26325 }
26326 }
26327}
26328#[doc = "id: 143"]
26329#[doc = "Barometer readings for 3rd barometer."]
26330#[derive(Debug, Clone, PartialEq)]
26331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26333pub struct SCALED_PRESSURE3_DATA {
26334 #[doc = "Timestamp (time since system boot)."]
26335 pub time_boot_ms: u32,
26336 #[doc = "Absolute pressure"]
26337 pub press_abs: f32,
26338 #[doc = "Differential pressure"]
26339 pub press_diff: f32,
26340 #[doc = "Absolute pressure temperature"]
26341 pub temperature: i16,
26342 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26343 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26344 pub temperature_press_diff: i16,
26345}
26346impl SCALED_PRESSURE3_DATA {
26347 pub const ENCODED_LEN: usize = 16usize;
26348 pub const DEFAULT: Self = Self {
26349 time_boot_ms: 0_u32,
26350 press_abs: 0.0_f32,
26351 press_diff: 0.0_f32,
26352 temperature: 0_i16,
26353 temperature_press_diff: 0_i16,
26354 };
26355 #[cfg(feature = "arbitrary")]
26356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26357 use arbitrary::{Arbitrary, Unstructured};
26358 let mut buf = [0u8; 1024];
26359 rng.fill_bytes(&mut buf);
26360 let mut unstructured = Unstructured::new(&buf);
26361 Self::arbitrary(&mut unstructured).unwrap_or_default()
26362 }
26363}
26364impl Default for SCALED_PRESSURE3_DATA {
26365 fn default() -> Self {
26366 Self::DEFAULT.clone()
26367 }
26368}
26369impl MessageData for SCALED_PRESSURE3_DATA {
26370 type Message = MavMessage;
26371 const ID: u32 = 143u32;
26372 const NAME: &'static str = "SCALED_PRESSURE3";
26373 const EXTRA_CRC: u8 = 131u8;
26374 const ENCODED_LEN: usize = 16usize;
26375 fn deser(
26376 _version: MavlinkVersion,
26377 __input: &[u8],
26378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26379 let avail_len = __input.len();
26380 let mut payload_buf = [0; Self::ENCODED_LEN];
26381 let mut buf = if avail_len < Self::ENCODED_LEN {
26382 payload_buf[0..avail_len].copy_from_slice(__input);
26383 Bytes::new(&payload_buf)
26384 } else {
26385 Bytes::new(__input)
26386 };
26387 let mut __struct = Self::default();
26388 __struct.time_boot_ms = buf.get_u32_le();
26389 __struct.press_abs = buf.get_f32_le();
26390 __struct.press_diff = buf.get_f32_le();
26391 __struct.temperature = buf.get_i16_le();
26392 __struct.temperature_press_diff = buf.get_i16_le();
26393 Ok(__struct)
26394 }
26395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26396 let mut __tmp = BytesMut::new(bytes);
26397 #[allow(clippy::absurd_extreme_comparisons)]
26398 #[allow(unused_comparisons)]
26399 if __tmp.remaining() < Self::ENCODED_LEN {
26400 panic!(
26401 "buffer is too small (need {} bytes, but got {})",
26402 Self::ENCODED_LEN,
26403 __tmp.remaining(),
26404 )
26405 }
26406 __tmp.put_u32_le(self.time_boot_ms);
26407 __tmp.put_f32_le(self.press_abs);
26408 __tmp.put_f32_le(self.press_diff);
26409 __tmp.put_i16_le(self.temperature);
26410 __tmp.put_i16_le(self.temperature_press_diff);
26411 if matches!(version, MavlinkVersion::V2) {
26412 let len = __tmp.len();
26413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26414 } else {
26415 __tmp.len()
26416 }
26417 }
26418}
26419#[doc = "id: 126"]
26420#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26421#[derive(Debug, Clone, PartialEq)]
26422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26424pub struct SERIAL_CONTROL_DATA {
26425 #[doc = "Baudrate of transfer. Zero means no change."]
26426 pub baudrate: u32,
26427 #[doc = "Timeout for reply data"]
26428 pub timeout: u16,
26429 #[doc = "Serial control device type."]
26430 pub device: SerialControlDev,
26431 #[doc = "Bitmap of serial control flags."]
26432 pub flags: SerialControlFlag,
26433 #[doc = "how many bytes in this transfer"]
26434 pub count: u8,
26435 #[doc = "serial data"]
26436 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26437 pub data: [u8; 70],
26438 #[doc = "System ID"]
26439 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26440 pub target_system: u8,
26441 #[doc = "Component ID"]
26442 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26443 pub target_component: u8,
26444}
26445impl SERIAL_CONTROL_DATA {
26446 pub const ENCODED_LEN: usize = 81usize;
26447 pub const DEFAULT: Self = Self {
26448 baudrate: 0_u32,
26449 timeout: 0_u16,
26450 device: SerialControlDev::DEFAULT,
26451 flags: SerialControlFlag::DEFAULT,
26452 count: 0_u8,
26453 data: [0_u8; 70usize],
26454 target_system: 0_u8,
26455 target_component: 0_u8,
26456 };
26457 #[cfg(feature = "arbitrary")]
26458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26459 use arbitrary::{Arbitrary, Unstructured};
26460 let mut buf = [0u8; 1024];
26461 rng.fill_bytes(&mut buf);
26462 let mut unstructured = Unstructured::new(&buf);
26463 Self::arbitrary(&mut unstructured).unwrap_or_default()
26464 }
26465}
26466impl Default for SERIAL_CONTROL_DATA {
26467 fn default() -> Self {
26468 Self::DEFAULT.clone()
26469 }
26470}
26471impl MessageData for SERIAL_CONTROL_DATA {
26472 type Message = MavMessage;
26473 const ID: u32 = 126u32;
26474 const NAME: &'static str = "SERIAL_CONTROL";
26475 const EXTRA_CRC: u8 = 220u8;
26476 const ENCODED_LEN: usize = 81usize;
26477 fn deser(
26478 _version: MavlinkVersion,
26479 __input: &[u8],
26480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26481 let avail_len = __input.len();
26482 let mut payload_buf = [0; Self::ENCODED_LEN];
26483 let mut buf = if avail_len < Self::ENCODED_LEN {
26484 payload_buf[0..avail_len].copy_from_slice(__input);
26485 Bytes::new(&payload_buf)
26486 } else {
26487 Bytes::new(__input)
26488 };
26489 let mut __struct = Self::default();
26490 __struct.baudrate = buf.get_u32_le();
26491 __struct.timeout = buf.get_u16_le();
26492 let tmp = buf.get_u8();
26493 __struct.device =
26494 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26495 enum_type: "SerialControlDev",
26496 value: tmp as u32,
26497 })?;
26498 let tmp = buf.get_u8();
26499 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26500 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26501 flag_type: "SerialControlFlag",
26502 value: tmp as u32,
26503 })?;
26504 __struct.count = buf.get_u8();
26505 for v in &mut __struct.data {
26506 let val = buf.get_u8();
26507 *v = val;
26508 }
26509 __struct.target_system = buf.get_u8();
26510 __struct.target_component = buf.get_u8();
26511 Ok(__struct)
26512 }
26513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26514 let mut __tmp = BytesMut::new(bytes);
26515 #[allow(clippy::absurd_extreme_comparisons)]
26516 #[allow(unused_comparisons)]
26517 if __tmp.remaining() < Self::ENCODED_LEN {
26518 panic!(
26519 "buffer is too small (need {} bytes, but got {})",
26520 Self::ENCODED_LEN,
26521 __tmp.remaining(),
26522 )
26523 }
26524 __tmp.put_u32_le(self.baudrate);
26525 __tmp.put_u16_le(self.timeout);
26526 __tmp.put_u8(self.device as u8);
26527 __tmp.put_u8(self.flags.bits());
26528 __tmp.put_u8(self.count);
26529 for val in &self.data {
26530 __tmp.put_u8(*val);
26531 }
26532 __tmp.put_u8(self.target_system);
26533 __tmp.put_u8(self.target_component);
26534 if matches!(version, MavlinkVersion::V2) {
26535 let len = __tmp.len();
26536 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26537 } else {
26538 __tmp.len()
26539 }
26540 }
26541}
26542#[doc = "id: 36"]
26543#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26544#[derive(Debug, Clone, PartialEq)]
26545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26547pub struct SERVO_OUTPUT_RAW_DATA {
26548 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26549 pub time_usec: u32,
26550 #[doc = "Servo output 1 value"]
26551 pub servo1_raw: u16,
26552 #[doc = "Servo output 2 value"]
26553 pub servo2_raw: u16,
26554 #[doc = "Servo output 3 value"]
26555 pub servo3_raw: u16,
26556 #[doc = "Servo output 4 value"]
26557 pub servo4_raw: u16,
26558 #[doc = "Servo output 5 value"]
26559 pub servo5_raw: u16,
26560 #[doc = "Servo output 6 value"]
26561 pub servo6_raw: u16,
26562 #[doc = "Servo output 7 value"]
26563 pub servo7_raw: u16,
26564 #[doc = "Servo output 8 value"]
26565 pub servo8_raw: u16,
26566 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26567 pub port: u8,
26568 #[doc = "Servo output 9 value"]
26569 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26570 pub servo9_raw: u16,
26571 #[doc = "Servo output 10 value"]
26572 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26573 pub servo10_raw: u16,
26574 #[doc = "Servo output 11 value"]
26575 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26576 pub servo11_raw: u16,
26577 #[doc = "Servo output 12 value"]
26578 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26579 pub servo12_raw: u16,
26580 #[doc = "Servo output 13 value"]
26581 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26582 pub servo13_raw: u16,
26583 #[doc = "Servo output 14 value"]
26584 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26585 pub servo14_raw: u16,
26586 #[doc = "Servo output 15 value"]
26587 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26588 pub servo15_raw: u16,
26589 #[doc = "Servo output 16 value"]
26590 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26591 pub servo16_raw: u16,
26592}
26593impl SERVO_OUTPUT_RAW_DATA {
26594 pub const ENCODED_LEN: usize = 37usize;
26595 pub const DEFAULT: Self = Self {
26596 time_usec: 0_u32,
26597 servo1_raw: 0_u16,
26598 servo2_raw: 0_u16,
26599 servo3_raw: 0_u16,
26600 servo4_raw: 0_u16,
26601 servo5_raw: 0_u16,
26602 servo6_raw: 0_u16,
26603 servo7_raw: 0_u16,
26604 servo8_raw: 0_u16,
26605 port: 0_u8,
26606 servo9_raw: 0_u16,
26607 servo10_raw: 0_u16,
26608 servo11_raw: 0_u16,
26609 servo12_raw: 0_u16,
26610 servo13_raw: 0_u16,
26611 servo14_raw: 0_u16,
26612 servo15_raw: 0_u16,
26613 servo16_raw: 0_u16,
26614 };
26615 #[cfg(feature = "arbitrary")]
26616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26617 use arbitrary::{Arbitrary, Unstructured};
26618 let mut buf = [0u8; 1024];
26619 rng.fill_bytes(&mut buf);
26620 let mut unstructured = Unstructured::new(&buf);
26621 Self::arbitrary(&mut unstructured).unwrap_or_default()
26622 }
26623}
26624impl Default for SERVO_OUTPUT_RAW_DATA {
26625 fn default() -> Self {
26626 Self::DEFAULT.clone()
26627 }
26628}
26629impl MessageData for SERVO_OUTPUT_RAW_DATA {
26630 type Message = MavMessage;
26631 const ID: u32 = 36u32;
26632 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26633 const EXTRA_CRC: u8 = 222u8;
26634 const ENCODED_LEN: usize = 37usize;
26635 fn deser(
26636 _version: MavlinkVersion,
26637 __input: &[u8],
26638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26639 let avail_len = __input.len();
26640 let mut payload_buf = [0; Self::ENCODED_LEN];
26641 let mut buf = if avail_len < Self::ENCODED_LEN {
26642 payload_buf[0..avail_len].copy_from_slice(__input);
26643 Bytes::new(&payload_buf)
26644 } else {
26645 Bytes::new(__input)
26646 };
26647 let mut __struct = Self::default();
26648 __struct.time_usec = buf.get_u32_le();
26649 __struct.servo1_raw = buf.get_u16_le();
26650 __struct.servo2_raw = buf.get_u16_le();
26651 __struct.servo3_raw = buf.get_u16_le();
26652 __struct.servo4_raw = buf.get_u16_le();
26653 __struct.servo5_raw = buf.get_u16_le();
26654 __struct.servo6_raw = buf.get_u16_le();
26655 __struct.servo7_raw = buf.get_u16_le();
26656 __struct.servo8_raw = buf.get_u16_le();
26657 __struct.port = buf.get_u8();
26658 __struct.servo9_raw = buf.get_u16_le();
26659 __struct.servo10_raw = buf.get_u16_le();
26660 __struct.servo11_raw = buf.get_u16_le();
26661 __struct.servo12_raw = buf.get_u16_le();
26662 __struct.servo13_raw = buf.get_u16_le();
26663 __struct.servo14_raw = buf.get_u16_le();
26664 __struct.servo15_raw = buf.get_u16_le();
26665 __struct.servo16_raw = buf.get_u16_le();
26666 Ok(__struct)
26667 }
26668 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26669 let mut __tmp = BytesMut::new(bytes);
26670 #[allow(clippy::absurd_extreme_comparisons)]
26671 #[allow(unused_comparisons)]
26672 if __tmp.remaining() < Self::ENCODED_LEN {
26673 panic!(
26674 "buffer is too small (need {} bytes, but got {})",
26675 Self::ENCODED_LEN,
26676 __tmp.remaining(),
26677 )
26678 }
26679 __tmp.put_u32_le(self.time_usec);
26680 __tmp.put_u16_le(self.servo1_raw);
26681 __tmp.put_u16_le(self.servo2_raw);
26682 __tmp.put_u16_le(self.servo3_raw);
26683 __tmp.put_u16_le(self.servo4_raw);
26684 __tmp.put_u16_le(self.servo5_raw);
26685 __tmp.put_u16_le(self.servo6_raw);
26686 __tmp.put_u16_le(self.servo7_raw);
26687 __tmp.put_u16_le(self.servo8_raw);
26688 __tmp.put_u8(self.port);
26689 __tmp.put_u16_le(self.servo9_raw);
26690 __tmp.put_u16_le(self.servo10_raw);
26691 __tmp.put_u16_le(self.servo11_raw);
26692 __tmp.put_u16_le(self.servo12_raw);
26693 __tmp.put_u16_le(self.servo13_raw);
26694 __tmp.put_u16_le(self.servo14_raw);
26695 __tmp.put_u16_le(self.servo15_raw);
26696 __tmp.put_u16_le(self.servo16_raw);
26697 if matches!(version, MavlinkVersion::V2) {
26698 let len = __tmp.len();
26699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26700 } else {
26701 __tmp.len()
26702 }
26703 }
26704}
26705#[doc = "id: 256"]
26706#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
26707#[derive(Debug, Clone, PartialEq)]
26708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26710pub struct SETUP_SIGNING_DATA {
26711 #[doc = "initial timestamp"]
26712 pub initial_timestamp: u64,
26713 #[doc = "system id of the target"]
26714 pub target_system: u8,
26715 #[doc = "component ID of the target"]
26716 pub target_component: u8,
26717 #[doc = "signing key"]
26718 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26719 pub secret_key: [u8; 32],
26720}
26721impl SETUP_SIGNING_DATA {
26722 pub const ENCODED_LEN: usize = 42usize;
26723 pub const DEFAULT: Self = Self {
26724 initial_timestamp: 0_u64,
26725 target_system: 0_u8,
26726 target_component: 0_u8,
26727 secret_key: [0_u8; 32usize],
26728 };
26729 #[cfg(feature = "arbitrary")]
26730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26731 use arbitrary::{Arbitrary, Unstructured};
26732 let mut buf = [0u8; 1024];
26733 rng.fill_bytes(&mut buf);
26734 let mut unstructured = Unstructured::new(&buf);
26735 Self::arbitrary(&mut unstructured).unwrap_or_default()
26736 }
26737}
26738impl Default for SETUP_SIGNING_DATA {
26739 fn default() -> Self {
26740 Self::DEFAULT.clone()
26741 }
26742}
26743impl MessageData for SETUP_SIGNING_DATA {
26744 type Message = MavMessage;
26745 const ID: u32 = 256u32;
26746 const NAME: &'static str = "SETUP_SIGNING";
26747 const EXTRA_CRC: u8 = 71u8;
26748 const ENCODED_LEN: usize = 42usize;
26749 fn deser(
26750 _version: MavlinkVersion,
26751 __input: &[u8],
26752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26753 let avail_len = __input.len();
26754 let mut payload_buf = [0; Self::ENCODED_LEN];
26755 let mut buf = if avail_len < Self::ENCODED_LEN {
26756 payload_buf[0..avail_len].copy_from_slice(__input);
26757 Bytes::new(&payload_buf)
26758 } else {
26759 Bytes::new(__input)
26760 };
26761 let mut __struct = Self::default();
26762 __struct.initial_timestamp = buf.get_u64_le();
26763 __struct.target_system = buf.get_u8();
26764 __struct.target_component = buf.get_u8();
26765 for v in &mut __struct.secret_key {
26766 let val = buf.get_u8();
26767 *v = val;
26768 }
26769 Ok(__struct)
26770 }
26771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26772 let mut __tmp = BytesMut::new(bytes);
26773 #[allow(clippy::absurd_extreme_comparisons)]
26774 #[allow(unused_comparisons)]
26775 if __tmp.remaining() < Self::ENCODED_LEN {
26776 panic!(
26777 "buffer is too small (need {} bytes, but got {})",
26778 Self::ENCODED_LEN,
26779 __tmp.remaining(),
26780 )
26781 }
26782 __tmp.put_u64_le(self.initial_timestamp);
26783 __tmp.put_u8(self.target_system);
26784 __tmp.put_u8(self.target_component);
26785 for val in &self.secret_key {
26786 __tmp.put_u8(*val);
26787 }
26788 if matches!(version, MavlinkVersion::V2) {
26789 let len = __tmp.len();
26790 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26791 } else {
26792 __tmp.len()
26793 }
26794 }
26795}
26796#[doc = "id: 139"]
26797#[doc = "Set the vehicle attitude and body angular rates."]
26798#[derive(Debug, Clone, PartialEq)]
26799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26801pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
26802 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26803 pub time_usec: u64,
26804 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
26805 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26806 pub controls: [f32; 8],
26807 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
26808 pub group_mlx: u8,
26809 #[doc = "System ID"]
26810 pub target_system: u8,
26811 #[doc = "Component ID"]
26812 pub target_component: u8,
26813}
26814impl SET_ACTUATOR_CONTROL_TARGET_DATA {
26815 pub const ENCODED_LEN: usize = 43usize;
26816 pub const DEFAULT: Self = Self {
26817 time_usec: 0_u64,
26818 controls: [0.0_f32; 8usize],
26819 group_mlx: 0_u8,
26820 target_system: 0_u8,
26821 target_component: 0_u8,
26822 };
26823 #[cfg(feature = "arbitrary")]
26824 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26825 use arbitrary::{Arbitrary, Unstructured};
26826 let mut buf = [0u8; 1024];
26827 rng.fill_bytes(&mut buf);
26828 let mut unstructured = Unstructured::new(&buf);
26829 Self::arbitrary(&mut unstructured).unwrap_or_default()
26830 }
26831}
26832impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
26833 fn default() -> Self {
26834 Self::DEFAULT.clone()
26835 }
26836}
26837impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
26838 type Message = MavMessage;
26839 const ID: u32 = 139u32;
26840 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
26841 const EXTRA_CRC: u8 = 168u8;
26842 const ENCODED_LEN: usize = 43usize;
26843 fn deser(
26844 _version: MavlinkVersion,
26845 __input: &[u8],
26846 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26847 let avail_len = __input.len();
26848 let mut payload_buf = [0; Self::ENCODED_LEN];
26849 let mut buf = if avail_len < Self::ENCODED_LEN {
26850 payload_buf[0..avail_len].copy_from_slice(__input);
26851 Bytes::new(&payload_buf)
26852 } else {
26853 Bytes::new(__input)
26854 };
26855 let mut __struct = Self::default();
26856 __struct.time_usec = buf.get_u64_le();
26857 for v in &mut __struct.controls {
26858 let val = buf.get_f32_le();
26859 *v = val;
26860 }
26861 __struct.group_mlx = buf.get_u8();
26862 __struct.target_system = buf.get_u8();
26863 __struct.target_component = buf.get_u8();
26864 Ok(__struct)
26865 }
26866 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26867 let mut __tmp = BytesMut::new(bytes);
26868 #[allow(clippy::absurd_extreme_comparisons)]
26869 #[allow(unused_comparisons)]
26870 if __tmp.remaining() < Self::ENCODED_LEN {
26871 panic!(
26872 "buffer is too small (need {} bytes, but got {})",
26873 Self::ENCODED_LEN,
26874 __tmp.remaining(),
26875 )
26876 }
26877 __tmp.put_u64_le(self.time_usec);
26878 for val in &self.controls {
26879 __tmp.put_f32_le(*val);
26880 }
26881 __tmp.put_u8(self.group_mlx);
26882 __tmp.put_u8(self.target_system);
26883 __tmp.put_u8(self.target_component);
26884 if matches!(version, MavlinkVersion::V2) {
26885 let len = __tmp.len();
26886 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26887 } else {
26888 __tmp.len()
26889 }
26890 }
26891}
26892#[doc = "id: 82"]
26893#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
26894#[derive(Debug, Clone, PartialEq)]
26895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26896#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26897pub struct SET_ATTITUDE_TARGET_DATA {
26898 #[doc = "Timestamp (time since system boot)."]
26899 pub time_boot_ms: u32,
26900 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
26901 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26902 pub q: [f32; 4],
26903 #[doc = "Body roll rate"]
26904 pub body_roll_rate: f32,
26905 #[doc = "Body pitch rate"]
26906 pub body_pitch_rate: f32,
26907 #[doc = "Body yaw rate"]
26908 pub body_yaw_rate: f32,
26909 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
26910 pub thrust: f32,
26911 #[doc = "System ID"]
26912 pub target_system: u8,
26913 #[doc = "Component ID"]
26914 pub target_component: u8,
26915 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
26916 pub type_mask: AttitudeTargetTypemask,
26917 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
26918 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26919 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26920 pub thrust_body: [f32; 3],
26921}
26922impl SET_ATTITUDE_TARGET_DATA {
26923 pub const ENCODED_LEN: usize = 51usize;
26924 pub const DEFAULT: Self = Self {
26925 time_boot_ms: 0_u32,
26926 q: [0.0_f32; 4usize],
26927 body_roll_rate: 0.0_f32,
26928 body_pitch_rate: 0.0_f32,
26929 body_yaw_rate: 0.0_f32,
26930 thrust: 0.0_f32,
26931 target_system: 0_u8,
26932 target_component: 0_u8,
26933 type_mask: AttitudeTargetTypemask::DEFAULT,
26934 thrust_body: [0.0_f32; 3usize],
26935 };
26936 #[cfg(feature = "arbitrary")]
26937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26938 use arbitrary::{Arbitrary, Unstructured};
26939 let mut buf = [0u8; 1024];
26940 rng.fill_bytes(&mut buf);
26941 let mut unstructured = Unstructured::new(&buf);
26942 Self::arbitrary(&mut unstructured).unwrap_or_default()
26943 }
26944}
26945impl Default for SET_ATTITUDE_TARGET_DATA {
26946 fn default() -> Self {
26947 Self::DEFAULT.clone()
26948 }
26949}
26950impl MessageData for SET_ATTITUDE_TARGET_DATA {
26951 type Message = MavMessage;
26952 const ID: u32 = 82u32;
26953 const NAME: &'static str = "SET_ATTITUDE_TARGET";
26954 const EXTRA_CRC: u8 = 49u8;
26955 const ENCODED_LEN: usize = 51usize;
26956 fn deser(
26957 _version: MavlinkVersion,
26958 __input: &[u8],
26959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26960 let avail_len = __input.len();
26961 let mut payload_buf = [0; Self::ENCODED_LEN];
26962 let mut buf = if avail_len < Self::ENCODED_LEN {
26963 payload_buf[0..avail_len].copy_from_slice(__input);
26964 Bytes::new(&payload_buf)
26965 } else {
26966 Bytes::new(__input)
26967 };
26968 let mut __struct = Self::default();
26969 __struct.time_boot_ms = buf.get_u32_le();
26970 for v in &mut __struct.q {
26971 let val = buf.get_f32_le();
26972 *v = val;
26973 }
26974 __struct.body_roll_rate = buf.get_f32_le();
26975 __struct.body_pitch_rate = buf.get_f32_le();
26976 __struct.body_yaw_rate = buf.get_f32_le();
26977 __struct.thrust = buf.get_f32_le();
26978 __struct.target_system = buf.get_u8();
26979 __struct.target_component = buf.get_u8();
26980 let tmp = buf.get_u8();
26981 __struct.type_mask = AttitudeTargetTypemask::from_bits(
26982 tmp & AttitudeTargetTypemask::all().bits(),
26983 )
26984 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26985 flag_type: "AttitudeTargetTypemask",
26986 value: tmp as u32,
26987 })?;
26988 for v in &mut __struct.thrust_body {
26989 let val = buf.get_f32_le();
26990 *v = val;
26991 }
26992 Ok(__struct)
26993 }
26994 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26995 let mut __tmp = BytesMut::new(bytes);
26996 #[allow(clippy::absurd_extreme_comparisons)]
26997 #[allow(unused_comparisons)]
26998 if __tmp.remaining() < Self::ENCODED_LEN {
26999 panic!(
27000 "buffer is too small (need {} bytes, but got {})",
27001 Self::ENCODED_LEN,
27002 __tmp.remaining(),
27003 )
27004 }
27005 __tmp.put_u32_le(self.time_boot_ms);
27006 for val in &self.q {
27007 __tmp.put_f32_le(*val);
27008 }
27009 __tmp.put_f32_le(self.body_roll_rate);
27010 __tmp.put_f32_le(self.body_pitch_rate);
27011 __tmp.put_f32_le(self.body_yaw_rate);
27012 __tmp.put_f32_le(self.thrust);
27013 __tmp.put_u8(self.target_system);
27014 __tmp.put_u8(self.target_component);
27015 __tmp.put_u8(self.type_mask.bits());
27016 for val in &self.thrust_body {
27017 __tmp.put_f32_le(*val);
27018 }
27019 if matches!(version, MavlinkVersion::V2) {
27020 let len = __tmp.len();
27021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27022 } else {
27023 __tmp.len()
27024 }
27025 }
27026}
27027#[doc = "id: 48"]
27028#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27029#[derive(Debug, Clone, PartialEq)]
27030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27032pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27033 #[doc = "Latitude (WGS84)"]
27034 pub latitude: i32,
27035 #[doc = "Longitude (WGS84)"]
27036 pub longitude: i32,
27037 #[doc = "Altitude (MSL). Positive for up."]
27038 pub altitude: i32,
27039 #[doc = "System ID"]
27040 pub target_system: u8,
27041 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27042 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27043 pub time_usec: u64,
27044}
27045impl SET_GPS_GLOBAL_ORIGIN_DATA {
27046 pub const ENCODED_LEN: usize = 21usize;
27047 pub const DEFAULT: Self = Self {
27048 latitude: 0_i32,
27049 longitude: 0_i32,
27050 altitude: 0_i32,
27051 target_system: 0_u8,
27052 time_usec: 0_u64,
27053 };
27054 #[cfg(feature = "arbitrary")]
27055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27056 use arbitrary::{Arbitrary, Unstructured};
27057 let mut buf = [0u8; 1024];
27058 rng.fill_bytes(&mut buf);
27059 let mut unstructured = Unstructured::new(&buf);
27060 Self::arbitrary(&mut unstructured).unwrap_or_default()
27061 }
27062}
27063impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27064 fn default() -> Self {
27065 Self::DEFAULT.clone()
27066 }
27067}
27068impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27069 type Message = MavMessage;
27070 const ID: u32 = 48u32;
27071 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27072 const EXTRA_CRC: u8 = 41u8;
27073 const ENCODED_LEN: usize = 21usize;
27074 fn deser(
27075 _version: MavlinkVersion,
27076 __input: &[u8],
27077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27078 let avail_len = __input.len();
27079 let mut payload_buf = [0; Self::ENCODED_LEN];
27080 let mut buf = if avail_len < Self::ENCODED_LEN {
27081 payload_buf[0..avail_len].copy_from_slice(__input);
27082 Bytes::new(&payload_buf)
27083 } else {
27084 Bytes::new(__input)
27085 };
27086 let mut __struct = Self::default();
27087 __struct.latitude = buf.get_i32_le();
27088 __struct.longitude = buf.get_i32_le();
27089 __struct.altitude = buf.get_i32_le();
27090 __struct.target_system = buf.get_u8();
27091 __struct.time_usec = buf.get_u64_le();
27092 Ok(__struct)
27093 }
27094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27095 let mut __tmp = BytesMut::new(bytes);
27096 #[allow(clippy::absurd_extreme_comparisons)]
27097 #[allow(unused_comparisons)]
27098 if __tmp.remaining() < Self::ENCODED_LEN {
27099 panic!(
27100 "buffer is too small (need {} bytes, but got {})",
27101 Self::ENCODED_LEN,
27102 __tmp.remaining(),
27103 )
27104 }
27105 __tmp.put_i32_le(self.latitude);
27106 __tmp.put_i32_le(self.longitude);
27107 __tmp.put_i32_le(self.altitude);
27108 __tmp.put_u8(self.target_system);
27109 __tmp.put_u64_le(self.time_usec);
27110 if matches!(version, MavlinkVersion::V2) {
27111 let len = __tmp.len();
27112 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27113 } else {
27114 __tmp.len()
27115 }
27116 }
27117}
27118#[doc = "id: 243"]
27119#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27120#[derive(Debug, Clone, PartialEq)]
27121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27123pub struct SET_HOME_POSITION_DATA {
27124 #[doc = "Latitude (WGS84)"]
27125 pub latitude: i32,
27126 #[doc = "Longitude (WGS84)"]
27127 pub longitude: i32,
27128 #[doc = "Altitude (MSL). Positive for up."]
27129 pub altitude: i32,
27130 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27131 pub x: f32,
27132 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27133 pub y: f32,
27134 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27135 pub z: f32,
27136 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27137 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27138 pub q: [f32; 4],
27139 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27140 pub approach_x: f32,
27141 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27142 pub approach_y: f32,
27143 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27144 pub approach_z: f32,
27145 #[doc = "System ID."]
27146 pub target_system: u8,
27147 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27148 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27149 pub time_usec: u64,
27150}
27151impl SET_HOME_POSITION_DATA {
27152 pub const ENCODED_LEN: usize = 61usize;
27153 pub const DEFAULT: Self = Self {
27154 latitude: 0_i32,
27155 longitude: 0_i32,
27156 altitude: 0_i32,
27157 x: 0.0_f32,
27158 y: 0.0_f32,
27159 z: 0.0_f32,
27160 q: [0.0_f32; 4usize],
27161 approach_x: 0.0_f32,
27162 approach_y: 0.0_f32,
27163 approach_z: 0.0_f32,
27164 target_system: 0_u8,
27165 time_usec: 0_u64,
27166 };
27167 #[cfg(feature = "arbitrary")]
27168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27169 use arbitrary::{Arbitrary, Unstructured};
27170 let mut buf = [0u8; 1024];
27171 rng.fill_bytes(&mut buf);
27172 let mut unstructured = Unstructured::new(&buf);
27173 Self::arbitrary(&mut unstructured).unwrap_or_default()
27174 }
27175}
27176impl Default for SET_HOME_POSITION_DATA {
27177 fn default() -> Self {
27178 Self::DEFAULT.clone()
27179 }
27180}
27181impl MessageData for SET_HOME_POSITION_DATA {
27182 type Message = MavMessage;
27183 const ID: u32 = 243u32;
27184 const NAME: &'static str = "SET_HOME_POSITION";
27185 const EXTRA_CRC: u8 = 85u8;
27186 const ENCODED_LEN: usize = 61usize;
27187 fn deser(
27188 _version: MavlinkVersion,
27189 __input: &[u8],
27190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27191 let avail_len = __input.len();
27192 let mut payload_buf = [0; Self::ENCODED_LEN];
27193 let mut buf = if avail_len < Self::ENCODED_LEN {
27194 payload_buf[0..avail_len].copy_from_slice(__input);
27195 Bytes::new(&payload_buf)
27196 } else {
27197 Bytes::new(__input)
27198 };
27199 let mut __struct = Self::default();
27200 __struct.latitude = buf.get_i32_le();
27201 __struct.longitude = buf.get_i32_le();
27202 __struct.altitude = buf.get_i32_le();
27203 __struct.x = buf.get_f32_le();
27204 __struct.y = buf.get_f32_le();
27205 __struct.z = buf.get_f32_le();
27206 for v in &mut __struct.q {
27207 let val = buf.get_f32_le();
27208 *v = val;
27209 }
27210 __struct.approach_x = buf.get_f32_le();
27211 __struct.approach_y = buf.get_f32_le();
27212 __struct.approach_z = buf.get_f32_le();
27213 __struct.target_system = buf.get_u8();
27214 __struct.time_usec = buf.get_u64_le();
27215 Ok(__struct)
27216 }
27217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27218 let mut __tmp = BytesMut::new(bytes);
27219 #[allow(clippy::absurd_extreme_comparisons)]
27220 #[allow(unused_comparisons)]
27221 if __tmp.remaining() < Self::ENCODED_LEN {
27222 panic!(
27223 "buffer is too small (need {} bytes, but got {})",
27224 Self::ENCODED_LEN,
27225 __tmp.remaining(),
27226 )
27227 }
27228 __tmp.put_i32_le(self.latitude);
27229 __tmp.put_i32_le(self.longitude);
27230 __tmp.put_i32_le(self.altitude);
27231 __tmp.put_f32_le(self.x);
27232 __tmp.put_f32_le(self.y);
27233 __tmp.put_f32_le(self.z);
27234 for val in &self.q {
27235 __tmp.put_f32_le(*val);
27236 }
27237 __tmp.put_f32_le(self.approach_x);
27238 __tmp.put_f32_le(self.approach_y);
27239 __tmp.put_f32_le(self.approach_z);
27240 __tmp.put_u8(self.target_system);
27241 __tmp.put_u64_le(self.time_usec);
27242 if matches!(version, MavlinkVersion::V2) {
27243 let len = __tmp.len();
27244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27245 } else {
27246 __tmp.len()
27247 }
27248 }
27249}
27250#[doc = "id: 11"]
27251#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27252#[derive(Debug, Clone, PartialEq)]
27253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27255pub struct SET_MODE_DATA {
27256 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27257 pub custom_mode: u32,
27258 #[doc = "The system setting the mode"]
27259 pub target_system: u8,
27260 #[doc = "The new base mode."]
27261 pub base_mode: MavMode,
27262}
27263impl SET_MODE_DATA {
27264 pub const ENCODED_LEN: usize = 6usize;
27265 pub const DEFAULT: Self = Self {
27266 custom_mode: 0_u32,
27267 target_system: 0_u8,
27268 base_mode: MavMode::DEFAULT,
27269 };
27270 #[cfg(feature = "arbitrary")]
27271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27272 use arbitrary::{Arbitrary, Unstructured};
27273 let mut buf = [0u8; 1024];
27274 rng.fill_bytes(&mut buf);
27275 let mut unstructured = Unstructured::new(&buf);
27276 Self::arbitrary(&mut unstructured).unwrap_or_default()
27277 }
27278}
27279impl Default for SET_MODE_DATA {
27280 fn default() -> Self {
27281 Self::DEFAULT.clone()
27282 }
27283}
27284impl MessageData for SET_MODE_DATA {
27285 type Message = MavMessage;
27286 const ID: u32 = 11u32;
27287 const NAME: &'static str = "SET_MODE";
27288 const EXTRA_CRC: u8 = 89u8;
27289 const ENCODED_LEN: usize = 6usize;
27290 fn deser(
27291 _version: MavlinkVersion,
27292 __input: &[u8],
27293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27294 let avail_len = __input.len();
27295 let mut payload_buf = [0; Self::ENCODED_LEN];
27296 let mut buf = if avail_len < Self::ENCODED_LEN {
27297 payload_buf[0..avail_len].copy_from_slice(__input);
27298 Bytes::new(&payload_buf)
27299 } else {
27300 Bytes::new(__input)
27301 };
27302 let mut __struct = Self::default();
27303 __struct.custom_mode = buf.get_u32_le();
27304 __struct.target_system = buf.get_u8();
27305 let tmp = buf.get_u8();
27306 __struct.base_mode =
27307 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27308 enum_type: "MavMode",
27309 value: tmp as u32,
27310 })?;
27311 Ok(__struct)
27312 }
27313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27314 let mut __tmp = BytesMut::new(bytes);
27315 #[allow(clippy::absurd_extreme_comparisons)]
27316 #[allow(unused_comparisons)]
27317 if __tmp.remaining() < Self::ENCODED_LEN {
27318 panic!(
27319 "buffer is too small (need {} bytes, but got {})",
27320 Self::ENCODED_LEN,
27321 __tmp.remaining(),
27322 )
27323 }
27324 __tmp.put_u32_le(self.custom_mode);
27325 __tmp.put_u8(self.target_system);
27326 __tmp.put_u8(self.base_mode as u8);
27327 if matches!(version, MavlinkVersion::V2) {
27328 let len = __tmp.len();
27329 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27330 } else {
27331 __tmp.len()
27332 }
27333 }
27334}
27335#[doc = "id: 86"]
27336#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27337#[derive(Debug, Clone, PartialEq)]
27338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27340pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27341 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27342 pub time_boot_ms: u32,
27343 #[doc = "Latitude in WGS84 frame"]
27344 pub lat_int: i32,
27345 #[doc = "Longitude in WGS84 frame"]
27346 pub lon_int: i32,
27347 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27348 pub alt: f32,
27349 #[doc = "X velocity in NED frame"]
27350 pub vx: f32,
27351 #[doc = "Y velocity in NED frame"]
27352 pub vy: f32,
27353 #[doc = "Z velocity in NED frame"]
27354 pub vz: f32,
27355 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27356 pub afx: f32,
27357 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27358 pub afy: f32,
27359 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27360 pub afz: f32,
27361 #[doc = "yaw setpoint"]
27362 pub yaw: f32,
27363 #[doc = "yaw rate setpoint"]
27364 pub yaw_rate: f32,
27365 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27366 pub type_mask: PositionTargetTypemask,
27367 #[doc = "System ID"]
27368 pub target_system: u8,
27369 #[doc = "Component ID"]
27370 pub target_component: u8,
27371 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27372 pub coordinate_frame: MavFrame,
27373}
27374impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27375 pub const ENCODED_LEN: usize = 53usize;
27376 pub const DEFAULT: Self = Self {
27377 time_boot_ms: 0_u32,
27378 lat_int: 0_i32,
27379 lon_int: 0_i32,
27380 alt: 0.0_f32,
27381 vx: 0.0_f32,
27382 vy: 0.0_f32,
27383 vz: 0.0_f32,
27384 afx: 0.0_f32,
27385 afy: 0.0_f32,
27386 afz: 0.0_f32,
27387 yaw: 0.0_f32,
27388 yaw_rate: 0.0_f32,
27389 type_mask: PositionTargetTypemask::DEFAULT,
27390 target_system: 0_u8,
27391 target_component: 0_u8,
27392 coordinate_frame: MavFrame::DEFAULT,
27393 };
27394 #[cfg(feature = "arbitrary")]
27395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27396 use arbitrary::{Arbitrary, Unstructured};
27397 let mut buf = [0u8; 1024];
27398 rng.fill_bytes(&mut buf);
27399 let mut unstructured = Unstructured::new(&buf);
27400 Self::arbitrary(&mut unstructured).unwrap_or_default()
27401 }
27402}
27403impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27404 fn default() -> Self {
27405 Self::DEFAULT.clone()
27406 }
27407}
27408impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27409 type Message = MavMessage;
27410 const ID: u32 = 86u32;
27411 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27412 const EXTRA_CRC: u8 = 5u8;
27413 const ENCODED_LEN: usize = 53usize;
27414 fn deser(
27415 _version: MavlinkVersion,
27416 __input: &[u8],
27417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27418 let avail_len = __input.len();
27419 let mut payload_buf = [0; Self::ENCODED_LEN];
27420 let mut buf = if avail_len < Self::ENCODED_LEN {
27421 payload_buf[0..avail_len].copy_from_slice(__input);
27422 Bytes::new(&payload_buf)
27423 } else {
27424 Bytes::new(__input)
27425 };
27426 let mut __struct = Self::default();
27427 __struct.time_boot_ms = buf.get_u32_le();
27428 __struct.lat_int = buf.get_i32_le();
27429 __struct.lon_int = buf.get_i32_le();
27430 __struct.alt = buf.get_f32_le();
27431 __struct.vx = buf.get_f32_le();
27432 __struct.vy = buf.get_f32_le();
27433 __struct.vz = buf.get_f32_le();
27434 __struct.afx = buf.get_f32_le();
27435 __struct.afy = buf.get_f32_le();
27436 __struct.afz = buf.get_f32_le();
27437 __struct.yaw = buf.get_f32_le();
27438 __struct.yaw_rate = buf.get_f32_le();
27439 let tmp = buf.get_u16_le();
27440 __struct.type_mask = PositionTargetTypemask::from_bits(
27441 tmp & PositionTargetTypemask::all().bits(),
27442 )
27443 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27444 flag_type: "PositionTargetTypemask",
27445 value: tmp as u32,
27446 })?;
27447 __struct.target_system = buf.get_u8();
27448 __struct.target_component = buf.get_u8();
27449 let tmp = buf.get_u8();
27450 __struct.coordinate_frame =
27451 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27452 enum_type: "MavFrame",
27453 value: tmp as u32,
27454 })?;
27455 Ok(__struct)
27456 }
27457 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27458 let mut __tmp = BytesMut::new(bytes);
27459 #[allow(clippy::absurd_extreme_comparisons)]
27460 #[allow(unused_comparisons)]
27461 if __tmp.remaining() < Self::ENCODED_LEN {
27462 panic!(
27463 "buffer is too small (need {} bytes, but got {})",
27464 Self::ENCODED_LEN,
27465 __tmp.remaining(),
27466 )
27467 }
27468 __tmp.put_u32_le(self.time_boot_ms);
27469 __tmp.put_i32_le(self.lat_int);
27470 __tmp.put_i32_le(self.lon_int);
27471 __tmp.put_f32_le(self.alt);
27472 __tmp.put_f32_le(self.vx);
27473 __tmp.put_f32_le(self.vy);
27474 __tmp.put_f32_le(self.vz);
27475 __tmp.put_f32_le(self.afx);
27476 __tmp.put_f32_le(self.afy);
27477 __tmp.put_f32_le(self.afz);
27478 __tmp.put_f32_le(self.yaw);
27479 __tmp.put_f32_le(self.yaw_rate);
27480 __tmp.put_u16_le(self.type_mask.bits());
27481 __tmp.put_u8(self.target_system);
27482 __tmp.put_u8(self.target_component);
27483 __tmp.put_u8(self.coordinate_frame as u8);
27484 if matches!(version, MavlinkVersion::V2) {
27485 let len = __tmp.len();
27486 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27487 } else {
27488 __tmp.len()
27489 }
27490 }
27491}
27492#[doc = "id: 84"]
27493#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27494#[derive(Debug, Clone, PartialEq)]
27495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27497pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27498 #[doc = "Timestamp (time since system boot)."]
27499 pub time_boot_ms: u32,
27500 #[doc = "X Position in NED frame"]
27501 pub x: f32,
27502 #[doc = "Y Position in NED frame"]
27503 pub y: f32,
27504 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27505 pub z: f32,
27506 #[doc = "X velocity in NED frame"]
27507 pub vx: f32,
27508 #[doc = "Y velocity in NED frame"]
27509 pub vy: f32,
27510 #[doc = "Z velocity in NED frame"]
27511 pub vz: f32,
27512 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27513 pub afx: f32,
27514 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27515 pub afy: f32,
27516 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27517 pub afz: f32,
27518 #[doc = "yaw setpoint"]
27519 pub yaw: f32,
27520 #[doc = "yaw rate setpoint"]
27521 pub yaw_rate: f32,
27522 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27523 pub type_mask: PositionTargetTypemask,
27524 #[doc = "System ID"]
27525 pub target_system: u8,
27526 #[doc = "Component ID"]
27527 pub target_component: u8,
27528 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27529 pub coordinate_frame: MavFrame,
27530}
27531impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27532 pub const ENCODED_LEN: usize = 53usize;
27533 pub const DEFAULT: Self = Self {
27534 time_boot_ms: 0_u32,
27535 x: 0.0_f32,
27536 y: 0.0_f32,
27537 z: 0.0_f32,
27538 vx: 0.0_f32,
27539 vy: 0.0_f32,
27540 vz: 0.0_f32,
27541 afx: 0.0_f32,
27542 afy: 0.0_f32,
27543 afz: 0.0_f32,
27544 yaw: 0.0_f32,
27545 yaw_rate: 0.0_f32,
27546 type_mask: PositionTargetTypemask::DEFAULT,
27547 target_system: 0_u8,
27548 target_component: 0_u8,
27549 coordinate_frame: MavFrame::DEFAULT,
27550 };
27551 #[cfg(feature = "arbitrary")]
27552 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27553 use arbitrary::{Arbitrary, Unstructured};
27554 let mut buf = [0u8; 1024];
27555 rng.fill_bytes(&mut buf);
27556 let mut unstructured = Unstructured::new(&buf);
27557 Self::arbitrary(&mut unstructured).unwrap_or_default()
27558 }
27559}
27560impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27561 fn default() -> Self {
27562 Self::DEFAULT.clone()
27563 }
27564}
27565impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27566 type Message = MavMessage;
27567 const ID: u32 = 84u32;
27568 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27569 const EXTRA_CRC: u8 = 143u8;
27570 const ENCODED_LEN: usize = 53usize;
27571 fn deser(
27572 _version: MavlinkVersion,
27573 __input: &[u8],
27574 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27575 let avail_len = __input.len();
27576 let mut payload_buf = [0; Self::ENCODED_LEN];
27577 let mut buf = if avail_len < Self::ENCODED_LEN {
27578 payload_buf[0..avail_len].copy_from_slice(__input);
27579 Bytes::new(&payload_buf)
27580 } else {
27581 Bytes::new(__input)
27582 };
27583 let mut __struct = Self::default();
27584 __struct.time_boot_ms = buf.get_u32_le();
27585 __struct.x = buf.get_f32_le();
27586 __struct.y = buf.get_f32_le();
27587 __struct.z = buf.get_f32_le();
27588 __struct.vx = buf.get_f32_le();
27589 __struct.vy = buf.get_f32_le();
27590 __struct.vz = buf.get_f32_le();
27591 __struct.afx = buf.get_f32_le();
27592 __struct.afy = buf.get_f32_le();
27593 __struct.afz = buf.get_f32_le();
27594 __struct.yaw = buf.get_f32_le();
27595 __struct.yaw_rate = buf.get_f32_le();
27596 let tmp = buf.get_u16_le();
27597 __struct.type_mask = PositionTargetTypemask::from_bits(
27598 tmp & PositionTargetTypemask::all().bits(),
27599 )
27600 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27601 flag_type: "PositionTargetTypemask",
27602 value: tmp as u32,
27603 })?;
27604 __struct.target_system = buf.get_u8();
27605 __struct.target_component = buf.get_u8();
27606 let tmp = buf.get_u8();
27607 __struct.coordinate_frame =
27608 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27609 enum_type: "MavFrame",
27610 value: tmp as u32,
27611 })?;
27612 Ok(__struct)
27613 }
27614 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27615 let mut __tmp = BytesMut::new(bytes);
27616 #[allow(clippy::absurd_extreme_comparisons)]
27617 #[allow(unused_comparisons)]
27618 if __tmp.remaining() < Self::ENCODED_LEN {
27619 panic!(
27620 "buffer is too small (need {} bytes, but got {})",
27621 Self::ENCODED_LEN,
27622 __tmp.remaining(),
27623 )
27624 }
27625 __tmp.put_u32_le(self.time_boot_ms);
27626 __tmp.put_f32_le(self.x);
27627 __tmp.put_f32_le(self.y);
27628 __tmp.put_f32_le(self.z);
27629 __tmp.put_f32_le(self.vx);
27630 __tmp.put_f32_le(self.vy);
27631 __tmp.put_f32_le(self.vz);
27632 __tmp.put_f32_le(self.afx);
27633 __tmp.put_f32_le(self.afy);
27634 __tmp.put_f32_le(self.afz);
27635 __tmp.put_f32_le(self.yaw);
27636 __tmp.put_f32_le(self.yaw_rate);
27637 __tmp.put_u16_le(self.type_mask.bits());
27638 __tmp.put_u8(self.target_system);
27639 __tmp.put_u8(self.target_component);
27640 __tmp.put_u8(self.coordinate_frame as u8);
27641 if matches!(version, MavlinkVersion::V2) {
27642 let len = __tmp.len();
27643 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27644 } else {
27645 __tmp.len()
27646 }
27647 }
27648}
27649#[doc = "id: 108"]
27650#[doc = "Status of simulation environment, if used."]
27651#[derive(Debug, Clone, PartialEq)]
27652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27654pub struct SIM_STATE_DATA {
27655 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
27656 pub q1: f32,
27657 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
27658 pub q2: f32,
27659 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
27660 pub q3: f32,
27661 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
27662 pub q4: f32,
27663 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
27664 pub roll: f32,
27665 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
27666 pub pitch: f32,
27667 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
27668 pub yaw: f32,
27669 #[doc = "X acceleration"]
27670 pub xacc: f32,
27671 #[doc = "Y acceleration"]
27672 pub yacc: f32,
27673 #[doc = "Z acceleration"]
27674 pub zacc: f32,
27675 #[doc = "Angular speed around X axis"]
27676 pub xgyro: f32,
27677 #[doc = "Angular speed around Y axis"]
27678 pub ygyro: f32,
27679 #[doc = "Angular speed around Z axis"]
27680 pub zgyro: f32,
27681 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
27682 pub lat: f32,
27683 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
27684 pub lon: f32,
27685 #[doc = "Altitude"]
27686 pub alt: f32,
27687 #[doc = "Horizontal position standard deviation"]
27688 pub std_dev_horz: f32,
27689 #[doc = "Vertical position standard deviation"]
27690 pub std_dev_vert: f32,
27691 #[doc = "True velocity in north direction in earth-fixed NED frame"]
27692 pub vn: f32,
27693 #[doc = "True velocity in east direction in earth-fixed NED frame"]
27694 pub ve: f32,
27695 #[doc = "True velocity in down direction in earth-fixed NED frame"]
27696 pub vd: f32,
27697 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
27698 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27699 pub lat_int: i32,
27700 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
27701 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27702 pub lon_int: i32,
27703}
27704impl SIM_STATE_DATA {
27705 pub const ENCODED_LEN: usize = 92usize;
27706 pub const DEFAULT: Self = Self {
27707 q1: 0.0_f32,
27708 q2: 0.0_f32,
27709 q3: 0.0_f32,
27710 q4: 0.0_f32,
27711 roll: 0.0_f32,
27712 pitch: 0.0_f32,
27713 yaw: 0.0_f32,
27714 xacc: 0.0_f32,
27715 yacc: 0.0_f32,
27716 zacc: 0.0_f32,
27717 xgyro: 0.0_f32,
27718 ygyro: 0.0_f32,
27719 zgyro: 0.0_f32,
27720 lat: 0.0_f32,
27721 lon: 0.0_f32,
27722 alt: 0.0_f32,
27723 std_dev_horz: 0.0_f32,
27724 std_dev_vert: 0.0_f32,
27725 vn: 0.0_f32,
27726 ve: 0.0_f32,
27727 vd: 0.0_f32,
27728 lat_int: 0_i32,
27729 lon_int: 0_i32,
27730 };
27731 #[cfg(feature = "arbitrary")]
27732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27733 use arbitrary::{Arbitrary, Unstructured};
27734 let mut buf = [0u8; 1024];
27735 rng.fill_bytes(&mut buf);
27736 let mut unstructured = Unstructured::new(&buf);
27737 Self::arbitrary(&mut unstructured).unwrap_or_default()
27738 }
27739}
27740impl Default for SIM_STATE_DATA {
27741 fn default() -> Self {
27742 Self::DEFAULT.clone()
27743 }
27744}
27745impl MessageData for SIM_STATE_DATA {
27746 type Message = MavMessage;
27747 const ID: u32 = 108u32;
27748 const NAME: &'static str = "SIM_STATE";
27749 const EXTRA_CRC: u8 = 32u8;
27750 const ENCODED_LEN: usize = 92usize;
27751 fn deser(
27752 _version: MavlinkVersion,
27753 __input: &[u8],
27754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27755 let avail_len = __input.len();
27756 let mut payload_buf = [0; Self::ENCODED_LEN];
27757 let mut buf = if avail_len < Self::ENCODED_LEN {
27758 payload_buf[0..avail_len].copy_from_slice(__input);
27759 Bytes::new(&payload_buf)
27760 } else {
27761 Bytes::new(__input)
27762 };
27763 let mut __struct = Self::default();
27764 __struct.q1 = buf.get_f32_le();
27765 __struct.q2 = buf.get_f32_le();
27766 __struct.q3 = buf.get_f32_le();
27767 __struct.q4 = buf.get_f32_le();
27768 __struct.roll = buf.get_f32_le();
27769 __struct.pitch = buf.get_f32_le();
27770 __struct.yaw = buf.get_f32_le();
27771 __struct.xacc = buf.get_f32_le();
27772 __struct.yacc = buf.get_f32_le();
27773 __struct.zacc = buf.get_f32_le();
27774 __struct.xgyro = buf.get_f32_le();
27775 __struct.ygyro = buf.get_f32_le();
27776 __struct.zgyro = buf.get_f32_le();
27777 __struct.lat = buf.get_f32_le();
27778 __struct.lon = buf.get_f32_le();
27779 __struct.alt = buf.get_f32_le();
27780 __struct.std_dev_horz = buf.get_f32_le();
27781 __struct.std_dev_vert = buf.get_f32_le();
27782 __struct.vn = buf.get_f32_le();
27783 __struct.ve = buf.get_f32_le();
27784 __struct.vd = buf.get_f32_le();
27785 __struct.lat_int = buf.get_i32_le();
27786 __struct.lon_int = buf.get_i32_le();
27787 Ok(__struct)
27788 }
27789 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27790 let mut __tmp = BytesMut::new(bytes);
27791 #[allow(clippy::absurd_extreme_comparisons)]
27792 #[allow(unused_comparisons)]
27793 if __tmp.remaining() < Self::ENCODED_LEN {
27794 panic!(
27795 "buffer is too small (need {} bytes, but got {})",
27796 Self::ENCODED_LEN,
27797 __tmp.remaining(),
27798 )
27799 }
27800 __tmp.put_f32_le(self.q1);
27801 __tmp.put_f32_le(self.q2);
27802 __tmp.put_f32_le(self.q3);
27803 __tmp.put_f32_le(self.q4);
27804 __tmp.put_f32_le(self.roll);
27805 __tmp.put_f32_le(self.pitch);
27806 __tmp.put_f32_le(self.yaw);
27807 __tmp.put_f32_le(self.xacc);
27808 __tmp.put_f32_le(self.yacc);
27809 __tmp.put_f32_le(self.zacc);
27810 __tmp.put_f32_le(self.xgyro);
27811 __tmp.put_f32_le(self.ygyro);
27812 __tmp.put_f32_le(self.zgyro);
27813 __tmp.put_f32_le(self.lat);
27814 __tmp.put_f32_le(self.lon);
27815 __tmp.put_f32_le(self.alt);
27816 __tmp.put_f32_le(self.std_dev_horz);
27817 __tmp.put_f32_le(self.std_dev_vert);
27818 __tmp.put_f32_le(self.vn);
27819 __tmp.put_f32_le(self.ve);
27820 __tmp.put_f32_le(self.vd);
27821 __tmp.put_i32_le(self.lat_int);
27822 __tmp.put_i32_le(self.lon_int);
27823 if matches!(version, MavlinkVersion::V2) {
27824 let len = __tmp.len();
27825 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27826 } else {
27827 __tmp.len()
27828 }
27829 }
27830}
27831#[doc = "id: 370"]
27832#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
27833#[derive(Debug, Clone, PartialEq)]
27834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27836pub struct SMART_BATTERY_INFO_DATA {
27837 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
27838 pub capacity_full_specification: i32,
27839 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
27840 pub capacity_full: i32,
27841 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
27842 pub cycle_count: u16,
27843 #[doc = "Battery weight. 0: field not provided."]
27844 pub weight: u16,
27845 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
27846 pub discharge_minimum_voltage: u16,
27847 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
27848 pub charging_minimum_voltage: u16,
27849 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
27850 pub resting_minimum_voltage: u16,
27851 #[doc = "Battery ID"]
27852 pub id: u8,
27853 #[doc = "Function of the battery"]
27854 pub battery_function: MavBatteryFunction,
27855 #[doc = "Type (chemistry) of the battery"]
27856 pub mavtype: MavBatteryType,
27857 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
27858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27859 pub serial_number: [u8; 16],
27860 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
27861 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27862 pub device_name: [u8; 50],
27863 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
27864 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27865 pub charging_maximum_voltage: u16,
27866 #[doc = "Number of battery cells in series. 0: field not provided."]
27867 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27868 pub cells_in_series: u8,
27869 #[doc = "Maximum pack discharge current. 0: field not provided."]
27870 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27871 pub discharge_maximum_current: u32,
27872 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
27873 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27874 pub discharge_maximum_burst_current: u32,
27875 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
27876 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27877 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27878 pub manufacture_date: [u8; 11],
27879}
27880impl SMART_BATTERY_INFO_DATA {
27881 pub const ENCODED_LEN: usize = 109usize;
27882 pub const DEFAULT: Self = Self {
27883 capacity_full_specification: 0_i32,
27884 capacity_full: 0_i32,
27885 cycle_count: 0_u16,
27886 weight: 0_u16,
27887 discharge_minimum_voltage: 0_u16,
27888 charging_minimum_voltage: 0_u16,
27889 resting_minimum_voltage: 0_u16,
27890 id: 0_u8,
27891 battery_function: MavBatteryFunction::DEFAULT,
27892 mavtype: MavBatteryType::DEFAULT,
27893 serial_number: [0_u8; 16usize],
27894 device_name: [0_u8; 50usize],
27895 charging_maximum_voltage: 0_u16,
27896 cells_in_series: 0_u8,
27897 discharge_maximum_current: 0_u32,
27898 discharge_maximum_burst_current: 0_u32,
27899 manufacture_date: [0_u8; 11usize],
27900 };
27901 #[cfg(feature = "arbitrary")]
27902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27903 use arbitrary::{Arbitrary, Unstructured};
27904 let mut buf = [0u8; 1024];
27905 rng.fill_bytes(&mut buf);
27906 let mut unstructured = Unstructured::new(&buf);
27907 Self::arbitrary(&mut unstructured).unwrap_or_default()
27908 }
27909}
27910impl Default for SMART_BATTERY_INFO_DATA {
27911 fn default() -> Self {
27912 Self::DEFAULT.clone()
27913 }
27914}
27915impl MessageData for SMART_BATTERY_INFO_DATA {
27916 type Message = MavMessage;
27917 const ID: u32 = 370u32;
27918 const NAME: &'static str = "SMART_BATTERY_INFO";
27919 const EXTRA_CRC: u8 = 75u8;
27920 const ENCODED_LEN: usize = 109usize;
27921 fn deser(
27922 _version: MavlinkVersion,
27923 __input: &[u8],
27924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27925 let avail_len = __input.len();
27926 let mut payload_buf = [0; Self::ENCODED_LEN];
27927 let mut buf = if avail_len < Self::ENCODED_LEN {
27928 payload_buf[0..avail_len].copy_from_slice(__input);
27929 Bytes::new(&payload_buf)
27930 } else {
27931 Bytes::new(__input)
27932 };
27933 let mut __struct = Self::default();
27934 __struct.capacity_full_specification = buf.get_i32_le();
27935 __struct.capacity_full = buf.get_i32_le();
27936 __struct.cycle_count = buf.get_u16_le();
27937 __struct.weight = buf.get_u16_le();
27938 __struct.discharge_minimum_voltage = buf.get_u16_le();
27939 __struct.charging_minimum_voltage = buf.get_u16_le();
27940 __struct.resting_minimum_voltage = buf.get_u16_le();
27941 __struct.id = buf.get_u8();
27942 let tmp = buf.get_u8();
27943 __struct.battery_function =
27944 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27945 enum_type: "MavBatteryFunction",
27946 value: tmp as u32,
27947 })?;
27948 let tmp = buf.get_u8();
27949 __struct.mavtype =
27950 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27951 enum_type: "MavBatteryType",
27952 value: tmp as u32,
27953 })?;
27954 for v in &mut __struct.serial_number {
27955 let val = buf.get_u8();
27956 *v = val;
27957 }
27958 for v in &mut __struct.device_name {
27959 let val = buf.get_u8();
27960 *v = val;
27961 }
27962 __struct.charging_maximum_voltage = buf.get_u16_le();
27963 __struct.cells_in_series = buf.get_u8();
27964 __struct.discharge_maximum_current = buf.get_u32_le();
27965 __struct.discharge_maximum_burst_current = buf.get_u32_le();
27966 for v in &mut __struct.manufacture_date {
27967 let val = buf.get_u8();
27968 *v = val;
27969 }
27970 Ok(__struct)
27971 }
27972 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27973 let mut __tmp = BytesMut::new(bytes);
27974 #[allow(clippy::absurd_extreme_comparisons)]
27975 #[allow(unused_comparisons)]
27976 if __tmp.remaining() < Self::ENCODED_LEN {
27977 panic!(
27978 "buffer is too small (need {} bytes, but got {})",
27979 Self::ENCODED_LEN,
27980 __tmp.remaining(),
27981 )
27982 }
27983 __tmp.put_i32_le(self.capacity_full_specification);
27984 __tmp.put_i32_le(self.capacity_full);
27985 __tmp.put_u16_le(self.cycle_count);
27986 __tmp.put_u16_le(self.weight);
27987 __tmp.put_u16_le(self.discharge_minimum_voltage);
27988 __tmp.put_u16_le(self.charging_minimum_voltage);
27989 __tmp.put_u16_le(self.resting_minimum_voltage);
27990 __tmp.put_u8(self.id);
27991 __tmp.put_u8(self.battery_function as u8);
27992 __tmp.put_u8(self.mavtype as u8);
27993 for val in &self.serial_number {
27994 __tmp.put_u8(*val);
27995 }
27996 for val in &self.device_name {
27997 __tmp.put_u8(*val);
27998 }
27999 __tmp.put_u16_le(self.charging_maximum_voltage);
28000 __tmp.put_u8(self.cells_in_series);
28001 __tmp.put_u32_le(self.discharge_maximum_current);
28002 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28003 for val in &self.manufacture_date {
28004 __tmp.put_u8(*val);
28005 }
28006 if matches!(version, MavlinkVersion::V2) {
28007 let len = __tmp.len();
28008 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28009 } else {
28010 __tmp.len()
28011 }
28012 }
28013}
28014#[doc = "id: 253"]
28015#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28016#[derive(Debug, Clone, PartialEq)]
28017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28019pub struct STATUSTEXT_DATA {
28020 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28021 pub severity: MavSeverity,
28022 #[doc = "Status text message, without null termination character"]
28023 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28024 pub text: [u8; 50],
28025 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28026 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28027 pub id: u16,
28028 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28029 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28030 pub chunk_seq: u8,
28031}
28032impl STATUSTEXT_DATA {
28033 pub const ENCODED_LEN: usize = 54usize;
28034 pub const DEFAULT: Self = Self {
28035 severity: MavSeverity::DEFAULT,
28036 text: [0_u8; 50usize],
28037 id: 0_u16,
28038 chunk_seq: 0_u8,
28039 };
28040 #[cfg(feature = "arbitrary")]
28041 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28042 use arbitrary::{Arbitrary, Unstructured};
28043 let mut buf = [0u8; 1024];
28044 rng.fill_bytes(&mut buf);
28045 let mut unstructured = Unstructured::new(&buf);
28046 Self::arbitrary(&mut unstructured).unwrap_or_default()
28047 }
28048}
28049impl Default for STATUSTEXT_DATA {
28050 fn default() -> Self {
28051 Self::DEFAULT.clone()
28052 }
28053}
28054impl MessageData for STATUSTEXT_DATA {
28055 type Message = MavMessage;
28056 const ID: u32 = 253u32;
28057 const NAME: &'static str = "STATUSTEXT";
28058 const EXTRA_CRC: u8 = 83u8;
28059 const ENCODED_LEN: usize = 54usize;
28060 fn deser(
28061 _version: MavlinkVersion,
28062 __input: &[u8],
28063 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28064 let avail_len = __input.len();
28065 let mut payload_buf = [0; Self::ENCODED_LEN];
28066 let mut buf = if avail_len < Self::ENCODED_LEN {
28067 payload_buf[0..avail_len].copy_from_slice(__input);
28068 Bytes::new(&payload_buf)
28069 } else {
28070 Bytes::new(__input)
28071 };
28072 let mut __struct = Self::default();
28073 let tmp = buf.get_u8();
28074 __struct.severity =
28075 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28076 enum_type: "MavSeverity",
28077 value: tmp as u32,
28078 })?;
28079 for v in &mut __struct.text {
28080 let val = buf.get_u8();
28081 *v = val;
28082 }
28083 __struct.id = buf.get_u16_le();
28084 __struct.chunk_seq = buf.get_u8();
28085 Ok(__struct)
28086 }
28087 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28088 let mut __tmp = BytesMut::new(bytes);
28089 #[allow(clippy::absurd_extreme_comparisons)]
28090 #[allow(unused_comparisons)]
28091 if __tmp.remaining() < Self::ENCODED_LEN {
28092 panic!(
28093 "buffer is too small (need {} bytes, but got {})",
28094 Self::ENCODED_LEN,
28095 __tmp.remaining(),
28096 )
28097 }
28098 __tmp.put_u8(self.severity as u8);
28099 for val in &self.text {
28100 __tmp.put_u8(*val);
28101 }
28102 __tmp.put_u16_le(self.id);
28103 __tmp.put_u8(self.chunk_seq);
28104 if matches!(version, MavlinkVersion::V2) {
28105 let len = __tmp.len();
28106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28107 } else {
28108 __tmp.len()
28109 }
28110 }
28111}
28112#[doc = "id: 261"]
28113#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28114#[derive(Debug, Clone, PartialEq)]
28115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28117pub struct STORAGE_INFORMATION_DATA {
28118 #[doc = "Timestamp (time since system boot)."]
28119 pub time_boot_ms: u32,
28120 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28121 pub total_capacity: f32,
28122 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28123 pub used_capacity: f32,
28124 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28125 pub available_capacity: f32,
28126 #[doc = "Read speed."]
28127 pub read_speed: f32,
28128 #[doc = "Write speed."]
28129 pub write_speed: f32,
28130 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28131 pub storage_id: u8,
28132 #[doc = "Number of storage devices"]
28133 pub storage_count: u8,
28134 #[doc = "Status of storage"]
28135 pub status: StorageStatus,
28136 #[doc = "Type of storage"]
28137 #[cfg_attr(feature = "serde", serde(default))]
28138 pub mavtype: StorageType,
28139 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28140 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28141 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28142 pub name: [u8; 32],
28143 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28144 #[cfg_attr(feature = "serde", serde(default))]
28145 pub storage_usage: StorageUsageFlag,
28146}
28147impl STORAGE_INFORMATION_DATA {
28148 pub const ENCODED_LEN: usize = 61usize;
28149 pub const DEFAULT: Self = Self {
28150 time_boot_ms: 0_u32,
28151 total_capacity: 0.0_f32,
28152 used_capacity: 0.0_f32,
28153 available_capacity: 0.0_f32,
28154 read_speed: 0.0_f32,
28155 write_speed: 0.0_f32,
28156 storage_id: 0_u8,
28157 storage_count: 0_u8,
28158 status: StorageStatus::DEFAULT,
28159 mavtype: StorageType::DEFAULT,
28160 name: [0_u8; 32usize],
28161 storage_usage: StorageUsageFlag::DEFAULT,
28162 };
28163 #[cfg(feature = "arbitrary")]
28164 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28165 use arbitrary::{Arbitrary, Unstructured};
28166 let mut buf = [0u8; 1024];
28167 rng.fill_bytes(&mut buf);
28168 let mut unstructured = Unstructured::new(&buf);
28169 Self::arbitrary(&mut unstructured).unwrap_or_default()
28170 }
28171}
28172impl Default for STORAGE_INFORMATION_DATA {
28173 fn default() -> Self {
28174 Self::DEFAULT.clone()
28175 }
28176}
28177impl MessageData for STORAGE_INFORMATION_DATA {
28178 type Message = MavMessage;
28179 const ID: u32 = 261u32;
28180 const NAME: &'static str = "STORAGE_INFORMATION";
28181 const EXTRA_CRC: u8 = 179u8;
28182 const ENCODED_LEN: usize = 61usize;
28183 fn deser(
28184 _version: MavlinkVersion,
28185 __input: &[u8],
28186 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28187 let avail_len = __input.len();
28188 let mut payload_buf = [0; Self::ENCODED_LEN];
28189 let mut buf = if avail_len < Self::ENCODED_LEN {
28190 payload_buf[0..avail_len].copy_from_slice(__input);
28191 Bytes::new(&payload_buf)
28192 } else {
28193 Bytes::new(__input)
28194 };
28195 let mut __struct = Self::default();
28196 __struct.time_boot_ms = buf.get_u32_le();
28197 __struct.total_capacity = buf.get_f32_le();
28198 __struct.used_capacity = buf.get_f32_le();
28199 __struct.available_capacity = buf.get_f32_le();
28200 __struct.read_speed = buf.get_f32_le();
28201 __struct.write_speed = buf.get_f32_le();
28202 __struct.storage_id = buf.get_u8();
28203 __struct.storage_count = buf.get_u8();
28204 let tmp = buf.get_u8();
28205 __struct.status =
28206 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28207 enum_type: "StorageStatus",
28208 value: tmp as u32,
28209 })?;
28210 let tmp = buf.get_u8();
28211 __struct.mavtype =
28212 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28213 enum_type: "StorageType",
28214 value: tmp as u32,
28215 })?;
28216 for v in &mut __struct.name {
28217 let val = buf.get_u8();
28218 *v = val;
28219 }
28220 let tmp = buf.get_u8();
28221 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28222 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28223 flag_type: "StorageUsageFlag",
28224 value: tmp as u32,
28225 })?;
28226 Ok(__struct)
28227 }
28228 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28229 let mut __tmp = BytesMut::new(bytes);
28230 #[allow(clippy::absurd_extreme_comparisons)]
28231 #[allow(unused_comparisons)]
28232 if __tmp.remaining() < Self::ENCODED_LEN {
28233 panic!(
28234 "buffer is too small (need {} bytes, but got {})",
28235 Self::ENCODED_LEN,
28236 __tmp.remaining(),
28237 )
28238 }
28239 __tmp.put_u32_le(self.time_boot_ms);
28240 __tmp.put_f32_le(self.total_capacity);
28241 __tmp.put_f32_le(self.used_capacity);
28242 __tmp.put_f32_le(self.available_capacity);
28243 __tmp.put_f32_le(self.read_speed);
28244 __tmp.put_f32_le(self.write_speed);
28245 __tmp.put_u8(self.storage_id);
28246 __tmp.put_u8(self.storage_count);
28247 __tmp.put_u8(self.status as u8);
28248 __tmp.put_u8(self.mavtype as u8);
28249 for val in &self.name {
28250 __tmp.put_u8(*val);
28251 }
28252 __tmp.put_u8(self.storage_usage.bits());
28253 if matches!(version, MavlinkVersion::V2) {
28254 let len = __tmp.len();
28255 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28256 } else {
28257 __tmp.len()
28258 }
28259 }
28260}
28261#[doc = "id: 401"]
28262#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28263#[derive(Debug, Clone, PartialEq)]
28264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28266pub struct SUPPORTED_TUNES_DATA {
28267 #[doc = "Bitfield of supported tune formats."]
28268 pub format: TuneFormat,
28269 #[doc = "System ID"]
28270 pub target_system: u8,
28271 #[doc = "Component ID"]
28272 pub target_component: u8,
28273}
28274impl SUPPORTED_TUNES_DATA {
28275 pub const ENCODED_LEN: usize = 6usize;
28276 pub const DEFAULT: Self = Self {
28277 format: TuneFormat::DEFAULT,
28278 target_system: 0_u8,
28279 target_component: 0_u8,
28280 };
28281 #[cfg(feature = "arbitrary")]
28282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28283 use arbitrary::{Arbitrary, Unstructured};
28284 let mut buf = [0u8; 1024];
28285 rng.fill_bytes(&mut buf);
28286 let mut unstructured = Unstructured::new(&buf);
28287 Self::arbitrary(&mut unstructured).unwrap_or_default()
28288 }
28289}
28290impl Default for SUPPORTED_TUNES_DATA {
28291 fn default() -> Self {
28292 Self::DEFAULT.clone()
28293 }
28294}
28295impl MessageData for SUPPORTED_TUNES_DATA {
28296 type Message = MavMessage;
28297 const ID: u32 = 401u32;
28298 const NAME: &'static str = "SUPPORTED_TUNES";
28299 const EXTRA_CRC: u8 = 183u8;
28300 const ENCODED_LEN: usize = 6usize;
28301 fn deser(
28302 _version: MavlinkVersion,
28303 __input: &[u8],
28304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28305 let avail_len = __input.len();
28306 let mut payload_buf = [0; Self::ENCODED_LEN];
28307 let mut buf = if avail_len < Self::ENCODED_LEN {
28308 payload_buf[0..avail_len].copy_from_slice(__input);
28309 Bytes::new(&payload_buf)
28310 } else {
28311 Bytes::new(__input)
28312 };
28313 let mut __struct = Self::default();
28314 let tmp = buf.get_u32_le();
28315 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28316 ::mavlink_core::error::ParserError::InvalidEnum {
28317 enum_type: "TuneFormat",
28318 value: tmp as u32,
28319 },
28320 )?;
28321 __struct.target_system = buf.get_u8();
28322 __struct.target_component = buf.get_u8();
28323 Ok(__struct)
28324 }
28325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28326 let mut __tmp = BytesMut::new(bytes);
28327 #[allow(clippy::absurd_extreme_comparisons)]
28328 #[allow(unused_comparisons)]
28329 if __tmp.remaining() < Self::ENCODED_LEN {
28330 panic!(
28331 "buffer is too small (need {} bytes, but got {})",
28332 Self::ENCODED_LEN,
28333 __tmp.remaining(),
28334 )
28335 }
28336 __tmp.put_u32_le(self.format as u32);
28337 __tmp.put_u8(self.target_system);
28338 __tmp.put_u8(self.target_component);
28339 if matches!(version, MavlinkVersion::V2) {
28340 let len = __tmp.len();
28341 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28342 } else {
28343 __tmp.len()
28344 }
28345 }
28346}
28347#[doc = "id: 2"]
28348#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28349#[derive(Debug, Clone, PartialEq)]
28350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28352pub struct SYSTEM_TIME_DATA {
28353 #[doc = "Timestamp (UNIX epoch time)."]
28354 pub time_unix_usec: u64,
28355 #[doc = "Timestamp (time since system boot)."]
28356 pub time_boot_ms: u32,
28357}
28358impl SYSTEM_TIME_DATA {
28359 pub const ENCODED_LEN: usize = 12usize;
28360 pub const DEFAULT: Self = Self {
28361 time_unix_usec: 0_u64,
28362 time_boot_ms: 0_u32,
28363 };
28364 #[cfg(feature = "arbitrary")]
28365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28366 use arbitrary::{Arbitrary, Unstructured};
28367 let mut buf = [0u8; 1024];
28368 rng.fill_bytes(&mut buf);
28369 let mut unstructured = Unstructured::new(&buf);
28370 Self::arbitrary(&mut unstructured).unwrap_or_default()
28371 }
28372}
28373impl Default for SYSTEM_TIME_DATA {
28374 fn default() -> Self {
28375 Self::DEFAULT.clone()
28376 }
28377}
28378impl MessageData for SYSTEM_TIME_DATA {
28379 type Message = MavMessage;
28380 const ID: u32 = 2u32;
28381 const NAME: &'static str = "SYSTEM_TIME";
28382 const EXTRA_CRC: u8 = 137u8;
28383 const ENCODED_LEN: usize = 12usize;
28384 fn deser(
28385 _version: MavlinkVersion,
28386 __input: &[u8],
28387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28388 let avail_len = __input.len();
28389 let mut payload_buf = [0; Self::ENCODED_LEN];
28390 let mut buf = if avail_len < Self::ENCODED_LEN {
28391 payload_buf[0..avail_len].copy_from_slice(__input);
28392 Bytes::new(&payload_buf)
28393 } else {
28394 Bytes::new(__input)
28395 };
28396 let mut __struct = Self::default();
28397 __struct.time_unix_usec = buf.get_u64_le();
28398 __struct.time_boot_ms = buf.get_u32_le();
28399 Ok(__struct)
28400 }
28401 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28402 let mut __tmp = BytesMut::new(bytes);
28403 #[allow(clippy::absurd_extreme_comparisons)]
28404 #[allow(unused_comparisons)]
28405 if __tmp.remaining() < Self::ENCODED_LEN {
28406 panic!(
28407 "buffer is too small (need {} bytes, but got {})",
28408 Self::ENCODED_LEN,
28409 __tmp.remaining(),
28410 )
28411 }
28412 __tmp.put_u64_le(self.time_unix_usec);
28413 __tmp.put_u32_le(self.time_boot_ms);
28414 if matches!(version, MavlinkVersion::V2) {
28415 let len = __tmp.len();
28416 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28417 } else {
28418 __tmp.len()
28419 }
28420 }
28421}
28422#[doc = "id: 1"]
28423#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28424#[derive(Debug, Clone, PartialEq)]
28425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28426#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28427pub struct SYS_STATUS_DATA {
28428 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28429 pub onboard_control_sensors_present: MavSysStatusSensor,
28430 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28431 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28432 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28433 pub onboard_control_sensors_health: MavSysStatusSensor,
28434 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28435 pub load: u16,
28436 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28437 pub voltage_battery: u16,
28438 #[doc = "Battery current, -1: Current not sent by autopilot"]
28439 pub current_battery: i16,
28440 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28441 pub drop_rate_comm: u16,
28442 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28443 pub errors_comm: u16,
28444 #[doc = "Autopilot-specific errors"]
28445 pub errors_count1: u16,
28446 #[doc = "Autopilot-specific errors"]
28447 pub errors_count2: u16,
28448 #[doc = "Autopilot-specific errors"]
28449 pub errors_count3: u16,
28450 #[doc = "Autopilot-specific errors"]
28451 pub errors_count4: u16,
28452 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28453 pub battery_remaining: i8,
28454 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28455 #[cfg_attr(feature = "serde", serde(default))]
28456 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28457 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28458 #[cfg_attr(feature = "serde", serde(default))]
28459 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28460 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28461 #[cfg_attr(feature = "serde", serde(default))]
28462 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28463}
28464impl SYS_STATUS_DATA {
28465 pub const ENCODED_LEN: usize = 43usize;
28466 pub const DEFAULT: Self = Self {
28467 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28468 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28469 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28470 load: 0_u16,
28471 voltage_battery: 0_u16,
28472 current_battery: 0_i16,
28473 drop_rate_comm: 0_u16,
28474 errors_comm: 0_u16,
28475 errors_count1: 0_u16,
28476 errors_count2: 0_u16,
28477 errors_count3: 0_u16,
28478 errors_count4: 0_u16,
28479 battery_remaining: 0_i8,
28480 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28481 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28482 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28483 };
28484 #[cfg(feature = "arbitrary")]
28485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28486 use arbitrary::{Arbitrary, Unstructured};
28487 let mut buf = [0u8; 1024];
28488 rng.fill_bytes(&mut buf);
28489 let mut unstructured = Unstructured::new(&buf);
28490 Self::arbitrary(&mut unstructured).unwrap_or_default()
28491 }
28492}
28493impl Default for SYS_STATUS_DATA {
28494 fn default() -> Self {
28495 Self::DEFAULT.clone()
28496 }
28497}
28498impl MessageData for SYS_STATUS_DATA {
28499 type Message = MavMessage;
28500 const ID: u32 = 1u32;
28501 const NAME: &'static str = "SYS_STATUS";
28502 const EXTRA_CRC: u8 = 124u8;
28503 const ENCODED_LEN: usize = 43usize;
28504 fn deser(
28505 _version: MavlinkVersion,
28506 __input: &[u8],
28507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28508 let avail_len = __input.len();
28509 let mut payload_buf = [0; Self::ENCODED_LEN];
28510 let mut buf = if avail_len < Self::ENCODED_LEN {
28511 payload_buf[0..avail_len].copy_from_slice(__input);
28512 Bytes::new(&payload_buf)
28513 } else {
28514 Bytes::new(__input)
28515 };
28516 let mut __struct = Self::default();
28517 let tmp = buf.get_u32_le();
28518 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28519 tmp & MavSysStatusSensor::all().bits(),
28520 )
28521 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28522 flag_type: "MavSysStatusSensor",
28523 value: tmp as u32,
28524 })?;
28525 let tmp = buf.get_u32_le();
28526 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28527 tmp & MavSysStatusSensor::all().bits(),
28528 )
28529 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28530 flag_type: "MavSysStatusSensor",
28531 value: tmp as u32,
28532 })?;
28533 let tmp = buf.get_u32_le();
28534 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28535 tmp & MavSysStatusSensor::all().bits(),
28536 )
28537 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28538 flag_type: "MavSysStatusSensor",
28539 value: tmp as u32,
28540 })?;
28541 __struct.load = buf.get_u16_le();
28542 __struct.voltage_battery = buf.get_u16_le();
28543 __struct.current_battery = buf.get_i16_le();
28544 __struct.drop_rate_comm = buf.get_u16_le();
28545 __struct.errors_comm = buf.get_u16_le();
28546 __struct.errors_count1 = buf.get_u16_le();
28547 __struct.errors_count2 = buf.get_u16_le();
28548 __struct.errors_count3 = buf.get_u16_le();
28549 __struct.errors_count4 = buf.get_u16_le();
28550 __struct.battery_remaining = buf.get_i8();
28551 let tmp = buf.get_u32_le();
28552 __struct.onboard_control_sensors_present_extended =
28553 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28554 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28555 flag_type: "MavSysStatusSensorExtended",
28556 value: tmp as u32,
28557 })?;
28558 let tmp = buf.get_u32_le();
28559 __struct.onboard_control_sensors_enabled_extended =
28560 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28561 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28562 flag_type: "MavSysStatusSensorExtended",
28563 value: tmp as u32,
28564 })?;
28565 let tmp = buf.get_u32_le();
28566 __struct.onboard_control_sensors_health_extended =
28567 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28568 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28569 flag_type: "MavSysStatusSensorExtended",
28570 value: tmp as u32,
28571 })?;
28572 Ok(__struct)
28573 }
28574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28575 let mut __tmp = BytesMut::new(bytes);
28576 #[allow(clippy::absurd_extreme_comparisons)]
28577 #[allow(unused_comparisons)]
28578 if __tmp.remaining() < Self::ENCODED_LEN {
28579 panic!(
28580 "buffer is too small (need {} bytes, but got {})",
28581 Self::ENCODED_LEN,
28582 __tmp.remaining(),
28583 )
28584 }
28585 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28586 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28587 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28588 __tmp.put_u16_le(self.load);
28589 __tmp.put_u16_le(self.voltage_battery);
28590 __tmp.put_i16_le(self.current_battery);
28591 __tmp.put_u16_le(self.drop_rate_comm);
28592 __tmp.put_u16_le(self.errors_comm);
28593 __tmp.put_u16_le(self.errors_count1);
28594 __tmp.put_u16_le(self.errors_count2);
28595 __tmp.put_u16_le(self.errors_count3);
28596 __tmp.put_u16_le(self.errors_count4);
28597 __tmp.put_i8(self.battery_remaining);
28598 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28599 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28600 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28601 if matches!(version, MavlinkVersion::V2) {
28602 let len = __tmp.len();
28603 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28604 } else {
28605 __tmp.len()
28606 }
28607 }
28608}
28609#[doc = "id: 135"]
28610#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28611#[derive(Debug, Clone, PartialEq)]
28612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28614pub struct TERRAIN_CHECK_DATA {
28615 #[doc = "Latitude"]
28616 pub lat: i32,
28617 #[doc = "Longitude"]
28618 pub lon: i32,
28619}
28620impl TERRAIN_CHECK_DATA {
28621 pub const ENCODED_LEN: usize = 8usize;
28622 pub const DEFAULT: Self = Self {
28623 lat: 0_i32,
28624 lon: 0_i32,
28625 };
28626 #[cfg(feature = "arbitrary")]
28627 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28628 use arbitrary::{Arbitrary, Unstructured};
28629 let mut buf = [0u8; 1024];
28630 rng.fill_bytes(&mut buf);
28631 let mut unstructured = Unstructured::new(&buf);
28632 Self::arbitrary(&mut unstructured).unwrap_or_default()
28633 }
28634}
28635impl Default for TERRAIN_CHECK_DATA {
28636 fn default() -> Self {
28637 Self::DEFAULT.clone()
28638 }
28639}
28640impl MessageData for TERRAIN_CHECK_DATA {
28641 type Message = MavMessage;
28642 const ID: u32 = 135u32;
28643 const NAME: &'static str = "TERRAIN_CHECK";
28644 const EXTRA_CRC: u8 = 203u8;
28645 const ENCODED_LEN: usize = 8usize;
28646 fn deser(
28647 _version: MavlinkVersion,
28648 __input: &[u8],
28649 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28650 let avail_len = __input.len();
28651 let mut payload_buf = [0; Self::ENCODED_LEN];
28652 let mut buf = if avail_len < Self::ENCODED_LEN {
28653 payload_buf[0..avail_len].copy_from_slice(__input);
28654 Bytes::new(&payload_buf)
28655 } else {
28656 Bytes::new(__input)
28657 };
28658 let mut __struct = Self::default();
28659 __struct.lat = buf.get_i32_le();
28660 __struct.lon = buf.get_i32_le();
28661 Ok(__struct)
28662 }
28663 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28664 let mut __tmp = BytesMut::new(bytes);
28665 #[allow(clippy::absurd_extreme_comparisons)]
28666 #[allow(unused_comparisons)]
28667 if __tmp.remaining() < Self::ENCODED_LEN {
28668 panic!(
28669 "buffer is too small (need {} bytes, but got {})",
28670 Self::ENCODED_LEN,
28671 __tmp.remaining(),
28672 )
28673 }
28674 __tmp.put_i32_le(self.lat);
28675 __tmp.put_i32_le(self.lon);
28676 if matches!(version, MavlinkVersion::V2) {
28677 let len = __tmp.len();
28678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28679 } else {
28680 __tmp.len()
28681 }
28682 }
28683}
28684#[doc = "id: 134"]
28685#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28686#[derive(Debug, Clone, PartialEq)]
28687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28689pub struct TERRAIN_DATA_DATA {
28690 #[doc = "Latitude of SW corner of first grid"]
28691 pub lat: i32,
28692 #[doc = "Longitude of SW corner of first grid"]
28693 pub lon: i32,
28694 #[doc = "Grid spacing"]
28695 pub grid_spacing: u16,
28696 #[doc = "Terrain data MSL"]
28697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28698 pub data: [i16; 16],
28699 #[doc = "bit within the terrain request mask"]
28700 pub gridbit: u8,
28701}
28702impl TERRAIN_DATA_DATA {
28703 pub const ENCODED_LEN: usize = 43usize;
28704 pub const DEFAULT: Self = Self {
28705 lat: 0_i32,
28706 lon: 0_i32,
28707 grid_spacing: 0_u16,
28708 data: [0_i16; 16usize],
28709 gridbit: 0_u8,
28710 };
28711 #[cfg(feature = "arbitrary")]
28712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28713 use arbitrary::{Arbitrary, Unstructured};
28714 let mut buf = [0u8; 1024];
28715 rng.fill_bytes(&mut buf);
28716 let mut unstructured = Unstructured::new(&buf);
28717 Self::arbitrary(&mut unstructured).unwrap_or_default()
28718 }
28719}
28720impl Default for TERRAIN_DATA_DATA {
28721 fn default() -> Self {
28722 Self::DEFAULT.clone()
28723 }
28724}
28725impl MessageData for TERRAIN_DATA_DATA {
28726 type Message = MavMessage;
28727 const ID: u32 = 134u32;
28728 const NAME: &'static str = "TERRAIN_DATA";
28729 const EXTRA_CRC: u8 = 229u8;
28730 const ENCODED_LEN: usize = 43usize;
28731 fn deser(
28732 _version: MavlinkVersion,
28733 __input: &[u8],
28734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28735 let avail_len = __input.len();
28736 let mut payload_buf = [0; Self::ENCODED_LEN];
28737 let mut buf = if avail_len < Self::ENCODED_LEN {
28738 payload_buf[0..avail_len].copy_from_slice(__input);
28739 Bytes::new(&payload_buf)
28740 } else {
28741 Bytes::new(__input)
28742 };
28743 let mut __struct = Self::default();
28744 __struct.lat = buf.get_i32_le();
28745 __struct.lon = buf.get_i32_le();
28746 __struct.grid_spacing = buf.get_u16_le();
28747 for v in &mut __struct.data {
28748 let val = buf.get_i16_le();
28749 *v = val;
28750 }
28751 __struct.gridbit = buf.get_u8();
28752 Ok(__struct)
28753 }
28754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28755 let mut __tmp = BytesMut::new(bytes);
28756 #[allow(clippy::absurd_extreme_comparisons)]
28757 #[allow(unused_comparisons)]
28758 if __tmp.remaining() < Self::ENCODED_LEN {
28759 panic!(
28760 "buffer is too small (need {} bytes, but got {})",
28761 Self::ENCODED_LEN,
28762 __tmp.remaining(),
28763 )
28764 }
28765 __tmp.put_i32_le(self.lat);
28766 __tmp.put_i32_le(self.lon);
28767 __tmp.put_u16_le(self.grid_spacing);
28768 for val in &self.data {
28769 __tmp.put_i16_le(*val);
28770 }
28771 __tmp.put_u8(self.gridbit);
28772 if matches!(version, MavlinkVersion::V2) {
28773 let len = __tmp.len();
28774 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28775 } else {
28776 __tmp.len()
28777 }
28778 }
28779}
28780#[doc = "id: 136"]
28781#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28782#[derive(Debug, Clone, PartialEq)]
28783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28785pub struct TERRAIN_REPORT_DATA {
28786 #[doc = "Latitude"]
28787 pub lat: i32,
28788 #[doc = "Longitude"]
28789 pub lon: i32,
28790 #[doc = "Terrain height MSL"]
28791 pub terrain_height: f32,
28792 #[doc = "Current vehicle height above lat/lon terrain height"]
28793 pub current_height: f32,
28794 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
28795 pub spacing: u16,
28796 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
28797 pub pending: u16,
28798 #[doc = "Number of 4x4 terrain blocks in memory"]
28799 pub loaded: u16,
28800}
28801impl TERRAIN_REPORT_DATA {
28802 pub const ENCODED_LEN: usize = 22usize;
28803 pub const DEFAULT: Self = Self {
28804 lat: 0_i32,
28805 lon: 0_i32,
28806 terrain_height: 0.0_f32,
28807 current_height: 0.0_f32,
28808 spacing: 0_u16,
28809 pending: 0_u16,
28810 loaded: 0_u16,
28811 };
28812 #[cfg(feature = "arbitrary")]
28813 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28814 use arbitrary::{Arbitrary, Unstructured};
28815 let mut buf = [0u8; 1024];
28816 rng.fill_bytes(&mut buf);
28817 let mut unstructured = Unstructured::new(&buf);
28818 Self::arbitrary(&mut unstructured).unwrap_or_default()
28819 }
28820}
28821impl Default for TERRAIN_REPORT_DATA {
28822 fn default() -> Self {
28823 Self::DEFAULT.clone()
28824 }
28825}
28826impl MessageData for TERRAIN_REPORT_DATA {
28827 type Message = MavMessage;
28828 const ID: u32 = 136u32;
28829 const NAME: &'static str = "TERRAIN_REPORT";
28830 const EXTRA_CRC: u8 = 1u8;
28831 const ENCODED_LEN: usize = 22usize;
28832 fn deser(
28833 _version: MavlinkVersion,
28834 __input: &[u8],
28835 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28836 let avail_len = __input.len();
28837 let mut payload_buf = [0; Self::ENCODED_LEN];
28838 let mut buf = if avail_len < Self::ENCODED_LEN {
28839 payload_buf[0..avail_len].copy_from_slice(__input);
28840 Bytes::new(&payload_buf)
28841 } else {
28842 Bytes::new(__input)
28843 };
28844 let mut __struct = Self::default();
28845 __struct.lat = buf.get_i32_le();
28846 __struct.lon = buf.get_i32_le();
28847 __struct.terrain_height = buf.get_f32_le();
28848 __struct.current_height = buf.get_f32_le();
28849 __struct.spacing = buf.get_u16_le();
28850 __struct.pending = buf.get_u16_le();
28851 __struct.loaded = buf.get_u16_le();
28852 Ok(__struct)
28853 }
28854 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28855 let mut __tmp = BytesMut::new(bytes);
28856 #[allow(clippy::absurd_extreme_comparisons)]
28857 #[allow(unused_comparisons)]
28858 if __tmp.remaining() < Self::ENCODED_LEN {
28859 panic!(
28860 "buffer is too small (need {} bytes, but got {})",
28861 Self::ENCODED_LEN,
28862 __tmp.remaining(),
28863 )
28864 }
28865 __tmp.put_i32_le(self.lat);
28866 __tmp.put_i32_le(self.lon);
28867 __tmp.put_f32_le(self.terrain_height);
28868 __tmp.put_f32_le(self.current_height);
28869 __tmp.put_u16_le(self.spacing);
28870 __tmp.put_u16_le(self.pending);
28871 __tmp.put_u16_le(self.loaded);
28872 if matches!(version, MavlinkVersion::V2) {
28873 let len = __tmp.len();
28874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28875 } else {
28876 __tmp.len()
28877 }
28878 }
28879}
28880#[doc = "id: 133"]
28881#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28882#[derive(Debug, Clone, PartialEq)]
28883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28885pub struct TERRAIN_REQUEST_DATA {
28886 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
28887 pub mask: u64,
28888 #[doc = "Latitude of SW corner of first grid"]
28889 pub lat: i32,
28890 #[doc = "Longitude of SW corner of first grid"]
28891 pub lon: i32,
28892 #[doc = "Grid spacing"]
28893 pub grid_spacing: u16,
28894}
28895impl TERRAIN_REQUEST_DATA {
28896 pub const ENCODED_LEN: usize = 18usize;
28897 pub const DEFAULT: Self = Self {
28898 mask: 0_u64,
28899 lat: 0_i32,
28900 lon: 0_i32,
28901 grid_spacing: 0_u16,
28902 };
28903 #[cfg(feature = "arbitrary")]
28904 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28905 use arbitrary::{Arbitrary, Unstructured};
28906 let mut buf = [0u8; 1024];
28907 rng.fill_bytes(&mut buf);
28908 let mut unstructured = Unstructured::new(&buf);
28909 Self::arbitrary(&mut unstructured).unwrap_or_default()
28910 }
28911}
28912impl Default for TERRAIN_REQUEST_DATA {
28913 fn default() -> Self {
28914 Self::DEFAULT.clone()
28915 }
28916}
28917impl MessageData for TERRAIN_REQUEST_DATA {
28918 type Message = MavMessage;
28919 const ID: u32 = 133u32;
28920 const NAME: &'static str = "TERRAIN_REQUEST";
28921 const EXTRA_CRC: u8 = 6u8;
28922 const ENCODED_LEN: usize = 18usize;
28923 fn deser(
28924 _version: MavlinkVersion,
28925 __input: &[u8],
28926 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28927 let avail_len = __input.len();
28928 let mut payload_buf = [0; Self::ENCODED_LEN];
28929 let mut buf = if avail_len < Self::ENCODED_LEN {
28930 payload_buf[0..avail_len].copy_from_slice(__input);
28931 Bytes::new(&payload_buf)
28932 } else {
28933 Bytes::new(__input)
28934 };
28935 let mut __struct = Self::default();
28936 __struct.mask = buf.get_u64_le();
28937 __struct.lat = buf.get_i32_le();
28938 __struct.lon = buf.get_i32_le();
28939 __struct.grid_spacing = buf.get_u16_le();
28940 Ok(__struct)
28941 }
28942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28943 let mut __tmp = BytesMut::new(bytes);
28944 #[allow(clippy::absurd_extreme_comparisons)]
28945 #[allow(unused_comparisons)]
28946 if __tmp.remaining() < Self::ENCODED_LEN {
28947 panic!(
28948 "buffer is too small (need {} bytes, but got {})",
28949 Self::ENCODED_LEN,
28950 __tmp.remaining(),
28951 )
28952 }
28953 __tmp.put_u64_le(self.mask);
28954 __tmp.put_i32_le(self.lat);
28955 __tmp.put_i32_le(self.lon);
28956 __tmp.put_u16_le(self.grid_spacing);
28957 if matches!(version, MavlinkVersion::V2) {
28958 let len = __tmp.len();
28959 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28960 } else {
28961 __tmp.len()
28962 }
28963 }
28964}
28965#[doc = "id: 111"]
28966#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
28967#[derive(Debug, Clone, PartialEq)]
28968#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28969#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28970pub struct TIMESYNC_DATA {
28971 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
28972 pub tc1: i64,
28973 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
28974 pub ts1: i64,
28975 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
28976 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28977 pub target_system: u8,
28978 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
28979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28980 pub target_component: u8,
28981}
28982impl TIMESYNC_DATA {
28983 pub const ENCODED_LEN: usize = 18usize;
28984 pub const DEFAULT: Self = Self {
28985 tc1: 0_i64,
28986 ts1: 0_i64,
28987 target_system: 0_u8,
28988 target_component: 0_u8,
28989 };
28990 #[cfg(feature = "arbitrary")]
28991 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28992 use arbitrary::{Arbitrary, Unstructured};
28993 let mut buf = [0u8; 1024];
28994 rng.fill_bytes(&mut buf);
28995 let mut unstructured = Unstructured::new(&buf);
28996 Self::arbitrary(&mut unstructured).unwrap_or_default()
28997 }
28998}
28999impl Default for TIMESYNC_DATA {
29000 fn default() -> Self {
29001 Self::DEFAULT.clone()
29002 }
29003}
29004impl MessageData for TIMESYNC_DATA {
29005 type Message = MavMessage;
29006 const ID: u32 = 111u32;
29007 const NAME: &'static str = "TIMESYNC";
29008 const EXTRA_CRC: u8 = 34u8;
29009 const ENCODED_LEN: usize = 18usize;
29010 fn deser(
29011 _version: MavlinkVersion,
29012 __input: &[u8],
29013 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29014 let avail_len = __input.len();
29015 let mut payload_buf = [0; Self::ENCODED_LEN];
29016 let mut buf = if avail_len < Self::ENCODED_LEN {
29017 payload_buf[0..avail_len].copy_from_slice(__input);
29018 Bytes::new(&payload_buf)
29019 } else {
29020 Bytes::new(__input)
29021 };
29022 let mut __struct = Self::default();
29023 __struct.tc1 = buf.get_i64_le();
29024 __struct.ts1 = buf.get_i64_le();
29025 __struct.target_system = buf.get_u8();
29026 __struct.target_component = buf.get_u8();
29027 Ok(__struct)
29028 }
29029 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29030 let mut __tmp = BytesMut::new(bytes);
29031 #[allow(clippy::absurd_extreme_comparisons)]
29032 #[allow(unused_comparisons)]
29033 if __tmp.remaining() < Self::ENCODED_LEN {
29034 panic!(
29035 "buffer is too small (need {} bytes, but got {})",
29036 Self::ENCODED_LEN,
29037 __tmp.remaining(),
29038 )
29039 }
29040 __tmp.put_i64_le(self.tc1);
29041 __tmp.put_i64_le(self.ts1);
29042 __tmp.put_u8(self.target_system);
29043 __tmp.put_u8(self.target_component);
29044 if matches!(version, MavlinkVersion::V2) {
29045 let len = __tmp.len();
29046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29047 } else {
29048 __tmp.len()
29049 }
29050 }
29051}
29052#[doc = "id: 380"]
29053#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29054#[derive(Debug, Clone, PartialEq)]
29055#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29057pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29058 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29059 pub safe_return: i32,
29060 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29061 pub land: i32,
29062 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29063 pub mission_next_item: i32,
29064 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29065 pub mission_end: i32,
29066 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29067 pub commanded_action: i32,
29068}
29069impl TIME_ESTIMATE_TO_TARGET_DATA {
29070 pub const ENCODED_LEN: usize = 20usize;
29071 pub const DEFAULT: Self = Self {
29072 safe_return: 0_i32,
29073 land: 0_i32,
29074 mission_next_item: 0_i32,
29075 mission_end: 0_i32,
29076 commanded_action: 0_i32,
29077 };
29078 #[cfg(feature = "arbitrary")]
29079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29080 use arbitrary::{Arbitrary, Unstructured};
29081 let mut buf = [0u8; 1024];
29082 rng.fill_bytes(&mut buf);
29083 let mut unstructured = Unstructured::new(&buf);
29084 Self::arbitrary(&mut unstructured).unwrap_or_default()
29085 }
29086}
29087impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29088 fn default() -> Self {
29089 Self::DEFAULT.clone()
29090 }
29091}
29092impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29093 type Message = MavMessage;
29094 const ID: u32 = 380u32;
29095 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29096 const EXTRA_CRC: u8 = 232u8;
29097 const ENCODED_LEN: usize = 20usize;
29098 fn deser(
29099 _version: MavlinkVersion,
29100 __input: &[u8],
29101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29102 let avail_len = __input.len();
29103 let mut payload_buf = [0; Self::ENCODED_LEN];
29104 let mut buf = if avail_len < Self::ENCODED_LEN {
29105 payload_buf[0..avail_len].copy_from_slice(__input);
29106 Bytes::new(&payload_buf)
29107 } else {
29108 Bytes::new(__input)
29109 };
29110 let mut __struct = Self::default();
29111 __struct.safe_return = buf.get_i32_le();
29112 __struct.land = buf.get_i32_le();
29113 __struct.mission_next_item = buf.get_i32_le();
29114 __struct.mission_end = buf.get_i32_le();
29115 __struct.commanded_action = buf.get_i32_le();
29116 Ok(__struct)
29117 }
29118 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29119 let mut __tmp = BytesMut::new(bytes);
29120 #[allow(clippy::absurd_extreme_comparisons)]
29121 #[allow(unused_comparisons)]
29122 if __tmp.remaining() < Self::ENCODED_LEN {
29123 panic!(
29124 "buffer is too small (need {} bytes, but got {})",
29125 Self::ENCODED_LEN,
29126 __tmp.remaining(),
29127 )
29128 }
29129 __tmp.put_i32_le(self.safe_return);
29130 __tmp.put_i32_le(self.land);
29131 __tmp.put_i32_le(self.mission_next_item);
29132 __tmp.put_i32_le(self.mission_end);
29133 __tmp.put_i32_le(self.commanded_action);
29134 if matches!(version, MavlinkVersion::V2) {
29135 let len = __tmp.len();
29136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29137 } else {
29138 __tmp.len()
29139 }
29140 }
29141}
29142#[doc = "id: 333"]
29143#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29144#[derive(Debug, Clone, PartialEq)]
29145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29146#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29147pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29148 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29149 pub time_usec: u64,
29150 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29151 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29152 pub pos_x: [f32; 5],
29153 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29154 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29155 pub pos_y: [f32; 5],
29156 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29157 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29158 pub pos_z: [f32; 5],
29159 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29160 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29161 pub delta: [f32; 5],
29162 #[doc = "Yaw. Set to NaN for unchanged"]
29163 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29164 pub pos_yaw: [f32; 5],
29165 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29166 pub valid_points: u8,
29167}
29168impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29169 pub const ENCODED_LEN: usize = 109usize;
29170 pub const DEFAULT: Self = Self {
29171 time_usec: 0_u64,
29172 pos_x: [0.0_f32; 5usize],
29173 pos_y: [0.0_f32; 5usize],
29174 pos_z: [0.0_f32; 5usize],
29175 delta: [0.0_f32; 5usize],
29176 pos_yaw: [0.0_f32; 5usize],
29177 valid_points: 0_u8,
29178 };
29179 #[cfg(feature = "arbitrary")]
29180 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29181 use arbitrary::{Arbitrary, Unstructured};
29182 let mut buf = [0u8; 1024];
29183 rng.fill_bytes(&mut buf);
29184 let mut unstructured = Unstructured::new(&buf);
29185 Self::arbitrary(&mut unstructured).unwrap_or_default()
29186 }
29187}
29188impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29189 fn default() -> Self {
29190 Self::DEFAULT.clone()
29191 }
29192}
29193impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29194 type Message = MavMessage;
29195 const ID: u32 = 333u32;
29196 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29197 const EXTRA_CRC: u8 = 231u8;
29198 const ENCODED_LEN: usize = 109usize;
29199 fn deser(
29200 _version: MavlinkVersion,
29201 __input: &[u8],
29202 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29203 let avail_len = __input.len();
29204 let mut payload_buf = [0; Self::ENCODED_LEN];
29205 let mut buf = if avail_len < Self::ENCODED_LEN {
29206 payload_buf[0..avail_len].copy_from_slice(__input);
29207 Bytes::new(&payload_buf)
29208 } else {
29209 Bytes::new(__input)
29210 };
29211 let mut __struct = Self::default();
29212 __struct.time_usec = buf.get_u64_le();
29213 for v in &mut __struct.pos_x {
29214 let val = buf.get_f32_le();
29215 *v = val;
29216 }
29217 for v in &mut __struct.pos_y {
29218 let val = buf.get_f32_le();
29219 *v = val;
29220 }
29221 for v in &mut __struct.pos_z {
29222 let val = buf.get_f32_le();
29223 *v = val;
29224 }
29225 for v in &mut __struct.delta {
29226 let val = buf.get_f32_le();
29227 *v = val;
29228 }
29229 for v in &mut __struct.pos_yaw {
29230 let val = buf.get_f32_le();
29231 *v = val;
29232 }
29233 __struct.valid_points = buf.get_u8();
29234 Ok(__struct)
29235 }
29236 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29237 let mut __tmp = BytesMut::new(bytes);
29238 #[allow(clippy::absurd_extreme_comparisons)]
29239 #[allow(unused_comparisons)]
29240 if __tmp.remaining() < Self::ENCODED_LEN {
29241 panic!(
29242 "buffer is too small (need {} bytes, but got {})",
29243 Self::ENCODED_LEN,
29244 __tmp.remaining(),
29245 )
29246 }
29247 __tmp.put_u64_le(self.time_usec);
29248 for val in &self.pos_x {
29249 __tmp.put_f32_le(*val);
29250 }
29251 for val in &self.pos_y {
29252 __tmp.put_f32_le(*val);
29253 }
29254 for val in &self.pos_z {
29255 __tmp.put_f32_le(*val);
29256 }
29257 for val in &self.delta {
29258 __tmp.put_f32_le(*val);
29259 }
29260 for val in &self.pos_yaw {
29261 __tmp.put_f32_le(*val);
29262 }
29263 __tmp.put_u8(self.valid_points);
29264 if matches!(version, MavlinkVersion::V2) {
29265 let len = __tmp.len();
29266 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29267 } else {
29268 __tmp.len()
29269 }
29270 }
29271}
29272#[doc = "id: 332"]
29273#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29274#[derive(Debug, Clone, PartialEq)]
29275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29277pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29278 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29279 pub time_usec: u64,
29280 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29281 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29282 pub pos_x: [f32; 5],
29283 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29284 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29285 pub pos_y: [f32; 5],
29286 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29287 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29288 pub pos_z: [f32; 5],
29289 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29290 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29291 pub vel_x: [f32; 5],
29292 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29293 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29294 pub vel_y: [f32; 5],
29295 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29296 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29297 pub vel_z: [f32; 5],
29298 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29299 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29300 pub acc_x: [f32; 5],
29301 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29302 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29303 pub acc_y: [f32; 5],
29304 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29305 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29306 pub acc_z: [f32; 5],
29307 #[doc = "Yaw angle, set to NaN if not being used"]
29308 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29309 pub pos_yaw: [f32; 5],
29310 #[doc = "Yaw rate, set to NaN if not being used"]
29311 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29312 pub vel_yaw: [f32; 5],
29313 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29314 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29315 pub command: [u16; 5],
29316 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29317 pub valid_points: u8,
29318}
29319impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29320 pub const ENCODED_LEN: usize = 239usize;
29321 pub const DEFAULT: Self = Self {
29322 time_usec: 0_u64,
29323 pos_x: [0.0_f32; 5usize],
29324 pos_y: [0.0_f32; 5usize],
29325 pos_z: [0.0_f32; 5usize],
29326 vel_x: [0.0_f32; 5usize],
29327 vel_y: [0.0_f32; 5usize],
29328 vel_z: [0.0_f32; 5usize],
29329 acc_x: [0.0_f32; 5usize],
29330 acc_y: [0.0_f32; 5usize],
29331 acc_z: [0.0_f32; 5usize],
29332 pos_yaw: [0.0_f32; 5usize],
29333 vel_yaw: [0.0_f32; 5usize],
29334 command: [0_u16; 5usize],
29335 valid_points: 0_u8,
29336 };
29337 #[cfg(feature = "arbitrary")]
29338 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29339 use arbitrary::{Arbitrary, Unstructured};
29340 let mut buf = [0u8; 1024];
29341 rng.fill_bytes(&mut buf);
29342 let mut unstructured = Unstructured::new(&buf);
29343 Self::arbitrary(&mut unstructured).unwrap_or_default()
29344 }
29345}
29346impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29347 fn default() -> Self {
29348 Self::DEFAULT.clone()
29349 }
29350}
29351impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29352 type Message = MavMessage;
29353 const ID: u32 = 332u32;
29354 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29355 const EXTRA_CRC: u8 = 236u8;
29356 const ENCODED_LEN: usize = 239usize;
29357 fn deser(
29358 _version: MavlinkVersion,
29359 __input: &[u8],
29360 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29361 let avail_len = __input.len();
29362 let mut payload_buf = [0; Self::ENCODED_LEN];
29363 let mut buf = if avail_len < Self::ENCODED_LEN {
29364 payload_buf[0..avail_len].copy_from_slice(__input);
29365 Bytes::new(&payload_buf)
29366 } else {
29367 Bytes::new(__input)
29368 };
29369 let mut __struct = Self::default();
29370 __struct.time_usec = buf.get_u64_le();
29371 for v in &mut __struct.pos_x {
29372 let val = buf.get_f32_le();
29373 *v = val;
29374 }
29375 for v in &mut __struct.pos_y {
29376 let val = buf.get_f32_le();
29377 *v = val;
29378 }
29379 for v in &mut __struct.pos_z {
29380 let val = buf.get_f32_le();
29381 *v = val;
29382 }
29383 for v in &mut __struct.vel_x {
29384 let val = buf.get_f32_le();
29385 *v = val;
29386 }
29387 for v in &mut __struct.vel_y {
29388 let val = buf.get_f32_le();
29389 *v = val;
29390 }
29391 for v in &mut __struct.vel_z {
29392 let val = buf.get_f32_le();
29393 *v = val;
29394 }
29395 for v in &mut __struct.acc_x {
29396 let val = buf.get_f32_le();
29397 *v = val;
29398 }
29399 for v in &mut __struct.acc_y {
29400 let val = buf.get_f32_le();
29401 *v = val;
29402 }
29403 for v in &mut __struct.acc_z {
29404 let val = buf.get_f32_le();
29405 *v = val;
29406 }
29407 for v in &mut __struct.pos_yaw {
29408 let val = buf.get_f32_le();
29409 *v = val;
29410 }
29411 for v in &mut __struct.vel_yaw {
29412 let val = buf.get_f32_le();
29413 *v = val;
29414 }
29415 for v in &mut __struct.command {
29416 let val = buf.get_u16_le();
29417 *v = val;
29418 }
29419 __struct.valid_points = buf.get_u8();
29420 Ok(__struct)
29421 }
29422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29423 let mut __tmp = BytesMut::new(bytes);
29424 #[allow(clippy::absurd_extreme_comparisons)]
29425 #[allow(unused_comparisons)]
29426 if __tmp.remaining() < Self::ENCODED_LEN {
29427 panic!(
29428 "buffer is too small (need {} bytes, but got {})",
29429 Self::ENCODED_LEN,
29430 __tmp.remaining(),
29431 )
29432 }
29433 __tmp.put_u64_le(self.time_usec);
29434 for val in &self.pos_x {
29435 __tmp.put_f32_le(*val);
29436 }
29437 for val in &self.pos_y {
29438 __tmp.put_f32_le(*val);
29439 }
29440 for val in &self.pos_z {
29441 __tmp.put_f32_le(*val);
29442 }
29443 for val in &self.vel_x {
29444 __tmp.put_f32_le(*val);
29445 }
29446 for val in &self.vel_y {
29447 __tmp.put_f32_le(*val);
29448 }
29449 for val in &self.vel_z {
29450 __tmp.put_f32_le(*val);
29451 }
29452 for val in &self.acc_x {
29453 __tmp.put_f32_le(*val);
29454 }
29455 for val in &self.acc_y {
29456 __tmp.put_f32_le(*val);
29457 }
29458 for val in &self.acc_z {
29459 __tmp.put_f32_le(*val);
29460 }
29461 for val in &self.pos_yaw {
29462 __tmp.put_f32_le(*val);
29463 }
29464 for val in &self.vel_yaw {
29465 __tmp.put_f32_le(*val);
29466 }
29467 for val in &self.command {
29468 __tmp.put_u16_le(*val);
29469 }
29470 __tmp.put_u8(self.valid_points);
29471 if matches!(version, MavlinkVersion::V2) {
29472 let len = __tmp.len();
29473 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29474 } else {
29475 __tmp.len()
29476 }
29477 }
29478}
29479#[doc = "id: 385"]
29480#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29481#[derive(Debug, Clone, PartialEq)]
29482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29484pub struct TUNNEL_DATA {
29485 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29486 pub payload_type: MavTunnelPayloadType,
29487 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29488 pub target_system: u8,
29489 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29490 pub target_component: u8,
29491 #[doc = "Length of the data transported in payload"]
29492 pub payload_length: u8,
29493 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29494 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29495 pub payload: [u8; 128],
29496}
29497impl TUNNEL_DATA {
29498 pub const ENCODED_LEN: usize = 133usize;
29499 pub const DEFAULT: Self = Self {
29500 payload_type: MavTunnelPayloadType::DEFAULT,
29501 target_system: 0_u8,
29502 target_component: 0_u8,
29503 payload_length: 0_u8,
29504 payload: [0_u8; 128usize],
29505 };
29506 #[cfg(feature = "arbitrary")]
29507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29508 use arbitrary::{Arbitrary, Unstructured};
29509 let mut buf = [0u8; 1024];
29510 rng.fill_bytes(&mut buf);
29511 let mut unstructured = Unstructured::new(&buf);
29512 Self::arbitrary(&mut unstructured).unwrap_or_default()
29513 }
29514}
29515impl Default for TUNNEL_DATA {
29516 fn default() -> Self {
29517 Self::DEFAULT.clone()
29518 }
29519}
29520impl MessageData for TUNNEL_DATA {
29521 type Message = MavMessage;
29522 const ID: u32 = 385u32;
29523 const NAME: &'static str = "TUNNEL";
29524 const EXTRA_CRC: u8 = 147u8;
29525 const ENCODED_LEN: usize = 133usize;
29526 fn deser(
29527 _version: MavlinkVersion,
29528 __input: &[u8],
29529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29530 let avail_len = __input.len();
29531 let mut payload_buf = [0; Self::ENCODED_LEN];
29532 let mut buf = if avail_len < Self::ENCODED_LEN {
29533 payload_buf[0..avail_len].copy_from_slice(__input);
29534 Bytes::new(&payload_buf)
29535 } else {
29536 Bytes::new(__input)
29537 };
29538 let mut __struct = Self::default();
29539 let tmp = buf.get_u16_le();
29540 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29541 ::mavlink_core::error::ParserError::InvalidEnum {
29542 enum_type: "MavTunnelPayloadType",
29543 value: tmp as u32,
29544 },
29545 )?;
29546 __struct.target_system = buf.get_u8();
29547 __struct.target_component = buf.get_u8();
29548 __struct.payload_length = buf.get_u8();
29549 for v in &mut __struct.payload {
29550 let val = buf.get_u8();
29551 *v = val;
29552 }
29553 Ok(__struct)
29554 }
29555 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29556 let mut __tmp = BytesMut::new(bytes);
29557 #[allow(clippy::absurd_extreme_comparisons)]
29558 #[allow(unused_comparisons)]
29559 if __tmp.remaining() < Self::ENCODED_LEN {
29560 panic!(
29561 "buffer is too small (need {} bytes, but got {})",
29562 Self::ENCODED_LEN,
29563 __tmp.remaining(),
29564 )
29565 }
29566 __tmp.put_u16_le(self.payload_type as u16);
29567 __tmp.put_u8(self.target_system);
29568 __tmp.put_u8(self.target_component);
29569 __tmp.put_u8(self.payload_length);
29570 for val in &self.payload {
29571 __tmp.put_u8(*val);
29572 }
29573 if matches!(version, MavlinkVersion::V2) {
29574 let len = __tmp.len();
29575 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29576 } else {
29577 __tmp.len()
29578 }
29579 }
29580}
29581#[doc = "id: 311"]
29582#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29583#[derive(Debug, Clone, PartialEq)]
29584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29586pub struct UAVCAN_NODE_INFO_DATA {
29587 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29588 pub time_usec: u64,
29589 #[doc = "Time since the start-up of the node."]
29590 pub uptime_sec: u32,
29591 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29592 pub sw_vcs_commit: u32,
29593 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29594 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29595 pub name: [u8; 80],
29596 #[doc = "Hardware major version number."]
29597 pub hw_version_major: u8,
29598 #[doc = "Hardware minor version number."]
29599 pub hw_version_minor: u8,
29600 #[doc = "Hardware unique 128-bit ID."]
29601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29602 pub hw_unique_id: [u8; 16],
29603 #[doc = "Software major version number."]
29604 pub sw_version_major: u8,
29605 #[doc = "Software minor version number."]
29606 pub sw_version_minor: u8,
29607}
29608impl UAVCAN_NODE_INFO_DATA {
29609 pub const ENCODED_LEN: usize = 116usize;
29610 pub const DEFAULT: Self = Self {
29611 time_usec: 0_u64,
29612 uptime_sec: 0_u32,
29613 sw_vcs_commit: 0_u32,
29614 name: [0_u8; 80usize],
29615 hw_version_major: 0_u8,
29616 hw_version_minor: 0_u8,
29617 hw_unique_id: [0_u8; 16usize],
29618 sw_version_major: 0_u8,
29619 sw_version_minor: 0_u8,
29620 };
29621 #[cfg(feature = "arbitrary")]
29622 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29623 use arbitrary::{Arbitrary, Unstructured};
29624 let mut buf = [0u8; 1024];
29625 rng.fill_bytes(&mut buf);
29626 let mut unstructured = Unstructured::new(&buf);
29627 Self::arbitrary(&mut unstructured).unwrap_or_default()
29628 }
29629}
29630impl Default for UAVCAN_NODE_INFO_DATA {
29631 fn default() -> Self {
29632 Self::DEFAULT.clone()
29633 }
29634}
29635impl MessageData for UAVCAN_NODE_INFO_DATA {
29636 type Message = MavMessage;
29637 const ID: u32 = 311u32;
29638 const NAME: &'static str = "UAVCAN_NODE_INFO";
29639 const EXTRA_CRC: u8 = 95u8;
29640 const ENCODED_LEN: usize = 116usize;
29641 fn deser(
29642 _version: MavlinkVersion,
29643 __input: &[u8],
29644 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29645 let avail_len = __input.len();
29646 let mut payload_buf = [0; Self::ENCODED_LEN];
29647 let mut buf = if avail_len < Self::ENCODED_LEN {
29648 payload_buf[0..avail_len].copy_from_slice(__input);
29649 Bytes::new(&payload_buf)
29650 } else {
29651 Bytes::new(__input)
29652 };
29653 let mut __struct = Self::default();
29654 __struct.time_usec = buf.get_u64_le();
29655 __struct.uptime_sec = buf.get_u32_le();
29656 __struct.sw_vcs_commit = buf.get_u32_le();
29657 for v in &mut __struct.name {
29658 let val = buf.get_u8();
29659 *v = val;
29660 }
29661 __struct.hw_version_major = buf.get_u8();
29662 __struct.hw_version_minor = buf.get_u8();
29663 for v in &mut __struct.hw_unique_id {
29664 let val = buf.get_u8();
29665 *v = val;
29666 }
29667 __struct.sw_version_major = buf.get_u8();
29668 __struct.sw_version_minor = buf.get_u8();
29669 Ok(__struct)
29670 }
29671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29672 let mut __tmp = BytesMut::new(bytes);
29673 #[allow(clippy::absurd_extreme_comparisons)]
29674 #[allow(unused_comparisons)]
29675 if __tmp.remaining() < Self::ENCODED_LEN {
29676 panic!(
29677 "buffer is too small (need {} bytes, but got {})",
29678 Self::ENCODED_LEN,
29679 __tmp.remaining(),
29680 )
29681 }
29682 __tmp.put_u64_le(self.time_usec);
29683 __tmp.put_u32_le(self.uptime_sec);
29684 __tmp.put_u32_le(self.sw_vcs_commit);
29685 for val in &self.name {
29686 __tmp.put_u8(*val);
29687 }
29688 __tmp.put_u8(self.hw_version_major);
29689 __tmp.put_u8(self.hw_version_minor);
29690 for val in &self.hw_unique_id {
29691 __tmp.put_u8(*val);
29692 }
29693 __tmp.put_u8(self.sw_version_major);
29694 __tmp.put_u8(self.sw_version_minor);
29695 if matches!(version, MavlinkVersion::V2) {
29696 let len = __tmp.len();
29697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29698 } else {
29699 __tmp.len()
29700 }
29701 }
29702}
29703#[doc = "id: 310"]
29704#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
29705#[derive(Debug, Clone, PartialEq)]
29706#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29707#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29708pub struct UAVCAN_NODE_STATUS_DATA {
29709 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29710 pub time_usec: u64,
29711 #[doc = "Time since the start-up of the node."]
29712 pub uptime_sec: u32,
29713 #[doc = "Vendor-specific status information."]
29714 pub vendor_specific_status_code: u16,
29715 #[doc = "Generalized node health status."]
29716 pub health: UavcanNodeHealth,
29717 #[doc = "Generalized operating mode."]
29718 pub mode: UavcanNodeMode,
29719 #[doc = "Not used currently."]
29720 pub sub_mode: u8,
29721}
29722impl UAVCAN_NODE_STATUS_DATA {
29723 pub const ENCODED_LEN: usize = 17usize;
29724 pub const DEFAULT: Self = Self {
29725 time_usec: 0_u64,
29726 uptime_sec: 0_u32,
29727 vendor_specific_status_code: 0_u16,
29728 health: UavcanNodeHealth::DEFAULT,
29729 mode: UavcanNodeMode::DEFAULT,
29730 sub_mode: 0_u8,
29731 };
29732 #[cfg(feature = "arbitrary")]
29733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29734 use arbitrary::{Arbitrary, Unstructured};
29735 let mut buf = [0u8; 1024];
29736 rng.fill_bytes(&mut buf);
29737 let mut unstructured = Unstructured::new(&buf);
29738 Self::arbitrary(&mut unstructured).unwrap_or_default()
29739 }
29740}
29741impl Default for UAVCAN_NODE_STATUS_DATA {
29742 fn default() -> Self {
29743 Self::DEFAULT.clone()
29744 }
29745}
29746impl MessageData for UAVCAN_NODE_STATUS_DATA {
29747 type Message = MavMessage;
29748 const ID: u32 = 310u32;
29749 const NAME: &'static str = "UAVCAN_NODE_STATUS";
29750 const EXTRA_CRC: u8 = 28u8;
29751 const ENCODED_LEN: usize = 17usize;
29752 fn deser(
29753 _version: MavlinkVersion,
29754 __input: &[u8],
29755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29756 let avail_len = __input.len();
29757 let mut payload_buf = [0; Self::ENCODED_LEN];
29758 let mut buf = if avail_len < Self::ENCODED_LEN {
29759 payload_buf[0..avail_len].copy_from_slice(__input);
29760 Bytes::new(&payload_buf)
29761 } else {
29762 Bytes::new(__input)
29763 };
29764 let mut __struct = Self::default();
29765 __struct.time_usec = buf.get_u64_le();
29766 __struct.uptime_sec = buf.get_u32_le();
29767 __struct.vendor_specific_status_code = buf.get_u16_le();
29768 let tmp = buf.get_u8();
29769 __struct.health =
29770 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29771 enum_type: "UavcanNodeHealth",
29772 value: tmp as u32,
29773 })?;
29774 let tmp = buf.get_u8();
29775 __struct.mode =
29776 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29777 enum_type: "UavcanNodeMode",
29778 value: tmp as u32,
29779 })?;
29780 __struct.sub_mode = buf.get_u8();
29781 Ok(__struct)
29782 }
29783 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29784 let mut __tmp = BytesMut::new(bytes);
29785 #[allow(clippy::absurd_extreme_comparisons)]
29786 #[allow(unused_comparisons)]
29787 if __tmp.remaining() < Self::ENCODED_LEN {
29788 panic!(
29789 "buffer is too small (need {} bytes, but got {})",
29790 Self::ENCODED_LEN,
29791 __tmp.remaining(),
29792 )
29793 }
29794 __tmp.put_u64_le(self.time_usec);
29795 __tmp.put_u32_le(self.uptime_sec);
29796 __tmp.put_u16_le(self.vendor_specific_status_code);
29797 __tmp.put_u8(self.health as u8);
29798 __tmp.put_u8(self.mode as u8);
29799 __tmp.put_u8(self.sub_mode);
29800 if matches!(version, MavlinkVersion::V2) {
29801 let len = __tmp.len();
29802 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29803 } else {
29804 __tmp.len()
29805 }
29806 }
29807}
29808#[doc = "id: 340"]
29809#[doc = "The global position resulting from GPS and sensor fusion."]
29810#[derive(Debug, Clone, PartialEq)]
29811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29813pub struct UTM_GLOBAL_POSITION_DATA {
29814 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
29815 pub time: u64,
29816 #[doc = "Latitude (WGS84)"]
29817 pub lat: i32,
29818 #[doc = "Longitude (WGS84)"]
29819 pub lon: i32,
29820 #[doc = "Altitude (WGS84)"]
29821 pub alt: i32,
29822 #[doc = "Altitude above ground"]
29823 pub relative_alt: i32,
29824 #[doc = "Next waypoint, latitude (WGS84)"]
29825 pub next_lat: i32,
29826 #[doc = "Next waypoint, longitude (WGS84)"]
29827 pub next_lon: i32,
29828 #[doc = "Next waypoint, altitude (WGS84)"]
29829 pub next_alt: i32,
29830 #[doc = "Ground X speed (latitude, positive north)"]
29831 pub vx: i16,
29832 #[doc = "Ground Y speed (longitude, positive east)"]
29833 pub vy: i16,
29834 #[doc = "Ground Z speed (altitude, positive down)"]
29835 pub vz: i16,
29836 #[doc = "Horizontal position uncertainty (standard deviation)"]
29837 pub h_acc: u16,
29838 #[doc = "Altitude uncertainty (standard deviation)"]
29839 pub v_acc: u16,
29840 #[doc = "Speed uncertainty (standard deviation)"]
29841 pub vel_acc: u16,
29842 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
29843 pub update_rate: u16,
29844 #[doc = "Unique UAS ID."]
29845 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29846 pub uas_id: [u8; 18],
29847 #[doc = "Flight state"]
29848 pub flight_state: UtmFlightState,
29849 #[doc = "Bitwise OR combination of the data available flags."]
29850 pub flags: UtmDataAvailFlags,
29851}
29852impl UTM_GLOBAL_POSITION_DATA {
29853 pub const ENCODED_LEN: usize = 70usize;
29854 pub const DEFAULT: Self = Self {
29855 time: 0_u64,
29856 lat: 0_i32,
29857 lon: 0_i32,
29858 alt: 0_i32,
29859 relative_alt: 0_i32,
29860 next_lat: 0_i32,
29861 next_lon: 0_i32,
29862 next_alt: 0_i32,
29863 vx: 0_i16,
29864 vy: 0_i16,
29865 vz: 0_i16,
29866 h_acc: 0_u16,
29867 v_acc: 0_u16,
29868 vel_acc: 0_u16,
29869 update_rate: 0_u16,
29870 uas_id: [0_u8; 18usize],
29871 flight_state: UtmFlightState::DEFAULT,
29872 flags: UtmDataAvailFlags::DEFAULT,
29873 };
29874 #[cfg(feature = "arbitrary")]
29875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29876 use arbitrary::{Arbitrary, Unstructured};
29877 let mut buf = [0u8; 1024];
29878 rng.fill_bytes(&mut buf);
29879 let mut unstructured = Unstructured::new(&buf);
29880 Self::arbitrary(&mut unstructured).unwrap_or_default()
29881 }
29882}
29883impl Default for UTM_GLOBAL_POSITION_DATA {
29884 fn default() -> Self {
29885 Self::DEFAULT.clone()
29886 }
29887}
29888impl MessageData for UTM_GLOBAL_POSITION_DATA {
29889 type Message = MavMessage;
29890 const ID: u32 = 340u32;
29891 const NAME: &'static str = "UTM_GLOBAL_POSITION";
29892 const EXTRA_CRC: u8 = 99u8;
29893 const ENCODED_LEN: usize = 70usize;
29894 fn deser(
29895 _version: MavlinkVersion,
29896 __input: &[u8],
29897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29898 let avail_len = __input.len();
29899 let mut payload_buf = [0; Self::ENCODED_LEN];
29900 let mut buf = if avail_len < Self::ENCODED_LEN {
29901 payload_buf[0..avail_len].copy_from_slice(__input);
29902 Bytes::new(&payload_buf)
29903 } else {
29904 Bytes::new(__input)
29905 };
29906 let mut __struct = Self::default();
29907 __struct.time = buf.get_u64_le();
29908 __struct.lat = buf.get_i32_le();
29909 __struct.lon = buf.get_i32_le();
29910 __struct.alt = buf.get_i32_le();
29911 __struct.relative_alt = buf.get_i32_le();
29912 __struct.next_lat = buf.get_i32_le();
29913 __struct.next_lon = buf.get_i32_le();
29914 __struct.next_alt = buf.get_i32_le();
29915 __struct.vx = buf.get_i16_le();
29916 __struct.vy = buf.get_i16_le();
29917 __struct.vz = buf.get_i16_le();
29918 __struct.h_acc = buf.get_u16_le();
29919 __struct.v_acc = buf.get_u16_le();
29920 __struct.vel_acc = buf.get_u16_le();
29921 __struct.update_rate = buf.get_u16_le();
29922 for v in &mut __struct.uas_id {
29923 let val = buf.get_u8();
29924 *v = val;
29925 }
29926 let tmp = buf.get_u8();
29927 __struct.flight_state =
29928 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29929 enum_type: "UtmFlightState",
29930 value: tmp as u32,
29931 })?;
29932 let tmp = buf.get_u8();
29933 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
29934 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29935 flag_type: "UtmDataAvailFlags",
29936 value: tmp as u32,
29937 })?;
29938 Ok(__struct)
29939 }
29940 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29941 let mut __tmp = BytesMut::new(bytes);
29942 #[allow(clippy::absurd_extreme_comparisons)]
29943 #[allow(unused_comparisons)]
29944 if __tmp.remaining() < Self::ENCODED_LEN {
29945 panic!(
29946 "buffer is too small (need {} bytes, but got {})",
29947 Self::ENCODED_LEN,
29948 __tmp.remaining(),
29949 )
29950 }
29951 __tmp.put_u64_le(self.time);
29952 __tmp.put_i32_le(self.lat);
29953 __tmp.put_i32_le(self.lon);
29954 __tmp.put_i32_le(self.alt);
29955 __tmp.put_i32_le(self.relative_alt);
29956 __tmp.put_i32_le(self.next_lat);
29957 __tmp.put_i32_le(self.next_lon);
29958 __tmp.put_i32_le(self.next_alt);
29959 __tmp.put_i16_le(self.vx);
29960 __tmp.put_i16_le(self.vy);
29961 __tmp.put_i16_le(self.vz);
29962 __tmp.put_u16_le(self.h_acc);
29963 __tmp.put_u16_le(self.v_acc);
29964 __tmp.put_u16_le(self.vel_acc);
29965 __tmp.put_u16_le(self.update_rate);
29966 for val in &self.uas_id {
29967 __tmp.put_u8(*val);
29968 }
29969 __tmp.put_u8(self.flight_state as u8);
29970 __tmp.put_u8(self.flags.bits());
29971 if matches!(version, MavlinkVersion::V2) {
29972 let len = __tmp.len();
29973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29974 } else {
29975 __tmp.len()
29976 }
29977 }
29978}
29979#[doc = "id: 248"]
29980#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
29981#[derive(Debug, Clone, PartialEq)]
29982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29984pub struct V2_EXTENSION_DATA {
29985 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29986 pub message_type: u16,
29987 #[doc = "Network ID (0 for broadcast)"]
29988 pub target_network: u8,
29989 #[doc = "System ID (0 for broadcast)"]
29990 pub target_system: u8,
29991 #[doc = "Component ID (0 for broadcast)"]
29992 pub target_component: u8,
29993 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
29994 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29995 pub payload: [u8; 249],
29996}
29997impl V2_EXTENSION_DATA {
29998 pub const ENCODED_LEN: usize = 254usize;
29999 pub const DEFAULT: Self = Self {
30000 message_type: 0_u16,
30001 target_network: 0_u8,
30002 target_system: 0_u8,
30003 target_component: 0_u8,
30004 payload: [0_u8; 249usize],
30005 };
30006 #[cfg(feature = "arbitrary")]
30007 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30008 use arbitrary::{Arbitrary, Unstructured};
30009 let mut buf = [0u8; 1024];
30010 rng.fill_bytes(&mut buf);
30011 let mut unstructured = Unstructured::new(&buf);
30012 Self::arbitrary(&mut unstructured).unwrap_or_default()
30013 }
30014}
30015impl Default for V2_EXTENSION_DATA {
30016 fn default() -> Self {
30017 Self::DEFAULT.clone()
30018 }
30019}
30020impl MessageData for V2_EXTENSION_DATA {
30021 type Message = MavMessage;
30022 const ID: u32 = 248u32;
30023 const NAME: &'static str = "V2_EXTENSION";
30024 const EXTRA_CRC: u8 = 8u8;
30025 const ENCODED_LEN: usize = 254usize;
30026 fn deser(
30027 _version: MavlinkVersion,
30028 __input: &[u8],
30029 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30030 let avail_len = __input.len();
30031 let mut payload_buf = [0; Self::ENCODED_LEN];
30032 let mut buf = if avail_len < Self::ENCODED_LEN {
30033 payload_buf[0..avail_len].copy_from_slice(__input);
30034 Bytes::new(&payload_buf)
30035 } else {
30036 Bytes::new(__input)
30037 };
30038 let mut __struct = Self::default();
30039 __struct.message_type = buf.get_u16_le();
30040 __struct.target_network = buf.get_u8();
30041 __struct.target_system = buf.get_u8();
30042 __struct.target_component = buf.get_u8();
30043 for v in &mut __struct.payload {
30044 let val = buf.get_u8();
30045 *v = val;
30046 }
30047 Ok(__struct)
30048 }
30049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30050 let mut __tmp = BytesMut::new(bytes);
30051 #[allow(clippy::absurd_extreme_comparisons)]
30052 #[allow(unused_comparisons)]
30053 if __tmp.remaining() < Self::ENCODED_LEN {
30054 panic!(
30055 "buffer is too small (need {} bytes, but got {})",
30056 Self::ENCODED_LEN,
30057 __tmp.remaining(),
30058 )
30059 }
30060 __tmp.put_u16_le(self.message_type);
30061 __tmp.put_u8(self.target_network);
30062 __tmp.put_u8(self.target_system);
30063 __tmp.put_u8(self.target_component);
30064 for val in &self.payload {
30065 __tmp.put_u8(*val);
30066 }
30067 if matches!(version, MavlinkVersion::V2) {
30068 let len = __tmp.len();
30069 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30070 } else {
30071 __tmp.len()
30072 }
30073 }
30074}
30075#[doc = "id: 74"]
30076#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30077#[derive(Debug, Clone, PartialEq)]
30078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30080pub struct VFR_HUD_DATA {
30081 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30082 pub airspeed: f32,
30083 #[doc = "Current ground speed."]
30084 pub groundspeed: f32,
30085 #[doc = "Current altitude (MSL)."]
30086 pub alt: f32,
30087 #[doc = "Current climb rate."]
30088 pub climb: f32,
30089 #[doc = "Current heading in compass units (0-360, 0=north)."]
30090 pub heading: i16,
30091 #[doc = "Current throttle setting (0 to 100)."]
30092 pub throttle: u16,
30093}
30094impl VFR_HUD_DATA {
30095 pub const ENCODED_LEN: usize = 20usize;
30096 pub const DEFAULT: Self = Self {
30097 airspeed: 0.0_f32,
30098 groundspeed: 0.0_f32,
30099 alt: 0.0_f32,
30100 climb: 0.0_f32,
30101 heading: 0_i16,
30102 throttle: 0_u16,
30103 };
30104 #[cfg(feature = "arbitrary")]
30105 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30106 use arbitrary::{Arbitrary, Unstructured};
30107 let mut buf = [0u8; 1024];
30108 rng.fill_bytes(&mut buf);
30109 let mut unstructured = Unstructured::new(&buf);
30110 Self::arbitrary(&mut unstructured).unwrap_or_default()
30111 }
30112}
30113impl Default for VFR_HUD_DATA {
30114 fn default() -> Self {
30115 Self::DEFAULT.clone()
30116 }
30117}
30118impl MessageData for VFR_HUD_DATA {
30119 type Message = MavMessage;
30120 const ID: u32 = 74u32;
30121 const NAME: &'static str = "VFR_HUD";
30122 const EXTRA_CRC: u8 = 20u8;
30123 const ENCODED_LEN: usize = 20usize;
30124 fn deser(
30125 _version: MavlinkVersion,
30126 __input: &[u8],
30127 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30128 let avail_len = __input.len();
30129 let mut payload_buf = [0; Self::ENCODED_LEN];
30130 let mut buf = if avail_len < Self::ENCODED_LEN {
30131 payload_buf[0..avail_len].copy_from_slice(__input);
30132 Bytes::new(&payload_buf)
30133 } else {
30134 Bytes::new(__input)
30135 };
30136 let mut __struct = Self::default();
30137 __struct.airspeed = buf.get_f32_le();
30138 __struct.groundspeed = buf.get_f32_le();
30139 __struct.alt = buf.get_f32_le();
30140 __struct.climb = buf.get_f32_le();
30141 __struct.heading = buf.get_i16_le();
30142 __struct.throttle = buf.get_u16_le();
30143 Ok(__struct)
30144 }
30145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30146 let mut __tmp = BytesMut::new(bytes);
30147 #[allow(clippy::absurd_extreme_comparisons)]
30148 #[allow(unused_comparisons)]
30149 if __tmp.remaining() < Self::ENCODED_LEN {
30150 panic!(
30151 "buffer is too small (need {} bytes, but got {})",
30152 Self::ENCODED_LEN,
30153 __tmp.remaining(),
30154 )
30155 }
30156 __tmp.put_f32_le(self.airspeed);
30157 __tmp.put_f32_le(self.groundspeed);
30158 __tmp.put_f32_le(self.alt);
30159 __tmp.put_f32_le(self.climb);
30160 __tmp.put_i16_le(self.heading);
30161 __tmp.put_u16_le(self.throttle);
30162 if matches!(version, MavlinkVersion::V2) {
30163 let len = __tmp.len();
30164 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30165 } else {
30166 __tmp.len()
30167 }
30168 }
30169}
30170#[doc = "id: 241"]
30171#[doc = "Vibration levels and accelerometer clipping."]
30172#[derive(Debug, Clone, PartialEq)]
30173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30175pub struct VIBRATION_DATA {
30176 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30177 pub time_usec: u64,
30178 #[doc = "Vibration levels on X-axis"]
30179 pub vibration_x: f32,
30180 #[doc = "Vibration levels on Y-axis"]
30181 pub vibration_y: f32,
30182 #[doc = "Vibration levels on Z-axis"]
30183 pub vibration_z: f32,
30184 #[doc = "first accelerometer clipping count"]
30185 pub clipping_0: u32,
30186 #[doc = "second accelerometer clipping count"]
30187 pub clipping_1: u32,
30188 #[doc = "third accelerometer clipping count"]
30189 pub clipping_2: u32,
30190}
30191impl VIBRATION_DATA {
30192 pub const ENCODED_LEN: usize = 32usize;
30193 pub const DEFAULT: Self = Self {
30194 time_usec: 0_u64,
30195 vibration_x: 0.0_f32,
30196 vibration_y: 0.0_f32,
30197 vibration_z: 0.0_f32,
30198 clipping_0: 0_u32,
30199 clipping_1: 0_u32,
30200 clipping_2: 0_u32,
30201 };
30202 #[cfg(feature = "arbitrary")]
30203 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30204 use arbitrary::{Arbitrary, Unstructured};
30205 let mut buf = [0u8; 1024];
30206 rng.fill_bytes(&mut buf);
30207 let mut unstructured = Unstructured::new(&buf);
30208 Self::arbitrary(&mut unstructured).unwrap_or_default()
30209 }
30210}
30211impl Default for VIBRATION_DATA {
30212 fn default() -> Self {
30213 Self::DEFAULT.clone()
30214 }
30215}
30216impl MessageData for VIBRATION_DATA {
30217 type Message = MavMessage;
30218 const ID: u32 = 241u32;
30219 const NAME: &'static str = "VIBRATION";
30220 const EXTRA_CRC: u8 = 90u8;
30221 const ENCODED_LEN: usize = 32usize;
30222 fn deser(
30223 _version: MavlinkVersion,
30224 __input: &[u8],
30225 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30226 let avail_len = __input.len();
30227 let mut payload_buf = [0; Self::ENCODED_LEN];
30228 let mut buf = if avail_len < Self::ENCODED_LEN {
30229 payload_buf[0..avail_len].copy_from_slice(__input);
30230 Bytes::new(&payload_buf)
30231 } else {
30232 Bytes::new(__input)
30233 };
30234 let mut __struct = Self::default();
30235 __struct.time_usec = buf.get_u64_le();
30236 __struct.vibration_x = buf.get_f32_le();
30237 __struct.vibration_y = buf.get_f32_le();
30238 __struct.vibration_z = buf.get_f32_le();
30239 __struct.clipping_0 = buf.get_u32_le();
30240 __struct.clipping_1 = buf.get_u32_le();
30241 __struct.clipping_2 = buf.get_u32_le();
30242 Ok(__struct)
30243 }
30244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30245 let mut __tmp = BytesMut::new(bytes);
30246 #[allow(clippy::absurd_extreme_comparisons)]
30247 #[allow(unused_comparisons)]
30248 if __tmp.remaining() < Self::ENCODED_LEN {
30249 panic!(
30250 "buffer is too small (need {} bytes, but got {})",
30251 Self::ENCODED_LEN,
30252 __tmp.remaining(),
30253 )
30254 }
30255 __tmp.put_u64_le(self.time_usec);
30256 __tmp.put_f32_le(self.vibration_x);
30257 __tmp.put_f32_le(self.vibration_y);
30258 __tmp.put_f32_le(self.vibration_z);
30259 __tmp.put_u32_le(self.clipping_0);
30260 __tmp.put_u32_le(self.clipping_1);
30261 __tmp.put_u32_le(self.clipping_2);
30262 if matches!(version, MavlinkVersion::V2) {
30263 let len = __tmp.len();
30264 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30265 } else {
30266 __tmp.len()
30267 }
30268 }
30269}
30270#[doc = "id: 104"]
30271#[doc = "Global position estimate from a Vicon motion system source."]
30272#[derive(Debug, Clone, PartialEq)]
30273#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30275pub struct VICON_POSITION_ESTIMATE_DATA {
30276 #[doc = "Timestamp (UNIX time or time since system boot)"]
30277 pub usec: u64,
30278 #[doc = "Global X position"]
30279 pub x: f32,
30280 #[doc = "Global Y position"]
30281 pub y: f32,
30282 #[doc = "Global Z position"]
30283 pub z: f32,
30284 #[doc = "Roll angle"]
30285 pub roll: f32,
30286 #[doc = "Pitch angle"]
30287 pub pitch: f32,
30288 #[doc = "Yaw angle"]
30289 pub yaw: f32,
30290 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30291 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30292 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30293 pub covariance: [f32; 21],
30294}
30295impl VICON_POSITION_ESTIMATE_DATA {
30296 pub const ENCODED_LEN: usize = 116usize;
30297 pub const DEFAULT: Self = Self {
30298 usec: 0_u64,
30299 x: 0.0_f32,
30300 y: 0.0_f32,
30301 z: 0.0_f32,
30302 roll: 0.0_f32,
30303 pitch: 0.0_f32,
30304 yaw: 0.0_f32,
30305 covariance: [0.0_f32; 21usize],
30306 };
30307 #[cfg(feature = "arbitrary")]
30308 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30309 use arbitrary::{Arbitrary, Unstructured};
30310 let mut buf = [0u8; 1024];
30311 rng.fill_bytes(&mut buf);
30312 let mut unstructured = Unstructured::new(&buf);
30313 Self::arbitrary(&mut unstructured).unwrap_or_default()
30314 }
30315}
30316impl Default for VICON_POSITION_ESTIMATE_DATA {
30317 fn default() -> Self {
30318 Self::DEFAULT.clone()
30319 }
30320}
30321impl MessageData for VICON_POSITION_ESTIMATE_DATA {
30322 type Message = MavMessage;
30323 const ID: u32 = 104u32;
30324 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
30325 const EXTRA_CRC: u8 = 56u8;
30326 const ENCODED_LEN: usize = 116usize;
30327 fn deser(
30328 _version: MavlinkVersion,
30329 __input: &[u8],
30330 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30331 let avail_len = __input.len();
30332 let mut payload_buf = [0; Self::ENCODED_LEN];
30333 let mut buf = if avail_len < Self::ENCODED_LEN {
30334 payload_buf[0..avail_len].copy_from_slice(__input);
30335 Bytes::new(&payload_buf)
30336 } else {
30337 Bytes::new(__input)
30338 };
30339 let mut __struct = Self::default();
30340 __struct.usec = buf.get_u64_le();
30341 __struct.x = buf.get_f32_le();
30342 __struct.y = buf.get_f32_le();
30343 __struct.z = buf.get_f32_le();
30344 __struct.roll = buf.get_f32_le();
30345 __struct.pitch = buf.get_f32_le();
30346 __struct.yaw = buf.get_f32_le();
30347 for v in &mut __struct.covariance {
30348 let val = buf.get_f32_le();
30349 *v = val;
30350 }
30351 Ok(__struct)
30352 }
30353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30354 let mut __tmp = BytesMut::new(bytes);
30355 #[allow(clippy::absurd_extreme_comparisons)]
30356 #[allow(unused_comparisons)]
30357 if __tmp.remaining() < Self::ENCODED_LEN {
30358 panic!(
30359 "buffer is too small (need {} bytes, but got {})",
30360 Self::ENCODED_LEN,
30361 __tmp.remaining(),
30362 )
30363 }
30364 __tmp.put_u64_le(self.usec);
30365 __tmp.put_f32_le(self.x);
30366 __tmp.put_f32_le(self.y);
30367 __tmp.put_f32_le(self.z);
30368 __tmp.put_f32_le(self.roll);
30369 __tmp.put_f32_le(self.pitch);
30370 __tmp.put_f32_le(self.yaw);
30371 for val in &self.covariance {
30372 __tmp.put_f32_le(*val);
30373 }
30374 if matches!(version, MavlinkVersion::V2) {
30375 let len = __tmp.len();
30376 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30377 } else {
30378 __tmp.len()
30379 }
30380 }
30381}
30382#[doc = "id: 269"]
30383#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
30384#[derive(Debug, Clone, PartialEq)]
30385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30387pub struct VIDEO_STREAM_INFORMATION_DATA {
30388 #[doc = "Frame rate."]
30389 pub framerate: f32,
30390 #[doc = "Bit rate."]
30391 pub bitrate: u32,
30392 #[doc = "Bitmap of stream status flags."]
30393 pub flags: VideoStreamStatusFlags,
30394 #[doc = "Horizontal resolution."]
30395 pub resolution_h: u16,
30396 #[doc = "Vertical resolution."]
30397 pub resolution_v: u16,
30398 #[doc = "Video image rotation clockwise."]
30399 pub rotation: u16,
30400 #[doc = "Horizontal Field of view."]
30401 pub hfov: u16,
30402 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30403 pub stream_id: u8,
30404 #[doc = "Number of streams available."]
30405 pub count: u8,
30406 #[doc = "Type of stream."]
30407 pub mavtype: VideoStreamType,
30408 #[doc = "Stream name."]
30409 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30410 pub name: [u8; 32],
30411 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
30412 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30413 pub uri: [u8; 160],
30414 #[doc = "Encoding of stream."]
30415 #[cfg_attr(feature = "serde", serde(default))]
30416 pub encoding: VideoStreamEncoding,
30417 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30418 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30419 pub camera_device_id: u8,
30420}
30421impl VIDEO_STREAM_INFORMATION_DATA {
30422 pub const ENCODED_LEN: usize = 215usize;
30423 pub const DEFAULT: Self = Self {
30424 framerate: 0.0_f32,
30425 bitrate: 0_u32,
30426 flags: VideoStreamStatusFlags::DEFAULT,
30427 resolution_h: 0_u16,
30428 resolution_v: 0_u16,
30429 rotation: 0_u16,
30430 hfov: 0_u16,
30431 stream_id: 0_u8,
30432 count: 0_u8,
30433 mavtype: VideoStreamType::DEFAULT,
30434 name: [0_u8; 32usize],
30435 uri: [0_u8; 160usize],
30436 encoding: VideoStreamEncoding::DEFAULT,
30437 camera_device_id: 0_u8,
30438 };
30439 #[cfg(feature = "arbitrary")]
30440 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30441 use arbitrary::{Arbitrary, Unstructured};
30442 let mut buf = [0u8; 1024];
30443 rng.fill_bytes(&mut buf);
30444 let mut unstructured = Unstructured::new(&buf);
30445 Self::arbitrary(&mut unstructured).unwrap_or_default()
30446 }
30447}
30448impl Default for VIDEO_STREAM_INFORMATION_DATA {
30449 fn default() -> Self {
30450 Self::DEFAULT.clone()
30451 }
30452}
30453impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
30454 type Message = MavMessage;
30455 const ID: u32 = 269u32;
30456 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
30457 const EXTRA_CRC: u8 = 109u8;
30458 const ENCODED_LEN: usize = 215usize;
30459 fn deser(
30460 _version: MavlinkVersion,
30461 __input: &[u8],
30462 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30463 let avail_len = __input.len();
30464 let mut payload_buf = [0; Self::ENCODED_LEN];
30465 let mut buf = if avail_len < Self::ENCODED_LEN {
30466 payload_buf[0..avail_len].copy_from_slice(__input);
30467 Bytes::new(&payload_buf)
30468 } else {
30469 Bytes::new(__input)
30470 };
30471 let mut __struct = Self::default();
30472 __struct.framerate = buf.get_f32_le();
30473 __struct.bitrate = buf.get_u32_le();
30474 let tmp = buf.get_u16_le();
30475 __struct.flags = VideoStreamStatusFlags::from_bits(
30476 tmp & VideoStreamStatusFlags::all().bits(),
30477 )
30478 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30479 flag_type: "VideoStreamStatusFlags",
30480 value: tmp as u32,
30481 })?;
30482 __struct.resolution_h = buf.get_u16_le();
30483 __struct.resolution_v = buf.get_u16_le();
30484 __struct.rotation = buf.get_u16_le();
30485 __struct.hfov = buf.get_u16_le();
30486 __struct.stream_id = buf.get_u8();
30487 __struct.count = buf.get_u8();
30488 let tmp = buf.get_u8();
30489 __struct.mavtype =
30490 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30491 enum_type: "VideoStreamType",
30492 value: tmp as u32,
30493 })?;
30494 for v in &mut __struct.name {
30495 let val = buf.get_u8();
30496 *v = val;
30497 }
30498 for v in &mut __struct.uri {
30499 let val = buf.get_u8();
30500 *v = val;
30501 }
30502 let tmp = buf.get_u8();
30503 __struct.encoding =
30504 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30505 enum_type: "VideoStreamEncoding",
30506 value: tmp as u32,
30507 })?;
30508 __struct.camera_device_id = buf.get_u8();
30509 Ok(__struct)
30510 }
30511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30512 let mut __tmp = BytesMut::new(bytes);
30513 #[allow(clippy::absurd_extreme_comparisons)]
30514 #[allow(unused_comparisons)]
30515 if __tmp.remaining() < Self::ENCODED_LEN {
30516 panic!(
30517 "buffer is too small (need {} bytes, but got {})",
30518 Self::ENCODED_LEN,
30519 __tmp.remaining(),
30520 )
30521 }
30522 __tmp.put_f32_le(self.framerate);
30523 __tmp.put_u32_le(self.bitrate);
30524 __tmp.put_u16_le(self.flags.bits());
30525 __tmp.put_u16_le(self.resolution_h);
30526 __tmp.put_u16_le(self.resolution_v);
30527 __tmp.put_u16_le(self.rotation);
30528 __tmp.put_u16_le(self.hfov);
30529 __tmp.put_u8(self.stream_id);
30530 __tmp.put_u8(self.count);
30531 __tmp.put_u8(self.mavtype as u8);
30532 for val in &self.name {
30533 __tmp.put_u8(*val);
30534 }
30535 for val in &self.uri {
30536 __tmp.put_u8(*val);
30537 }
30538 __tmp.put_u8(self.encoding as u8);
30539 __tmp.put_u8(self.camera_device_id);
30540 if matches!(version, MavlinkVersion::V2) {
30541 let len = __tmp.len();
30542 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30543 } else {
30544 __tmp.len()
30545 }
30546 }
30547}
30548#[doc = "id: 270"]
30549#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
30550#[derive(Debug, Clone, PartialEq)]
30551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30553pub struct VIDEO_STREAM_STATUS_DATA {
30554 #[doc = "Frame rate"]
30555 pub framerate: f32,
30556 #[doc = "Bit rate"]
30557 pub bitrate: u32,
30558 #[doc = "Bitmap of stream status flags"]
30559 pub flags: VideoStreamStatusFlags,
30560 #[doc = "Horizontal resolution"]
30561 pub resolution_h: u16,
30562 #[doc = "Vertical resolution"]
30563 pub resolution_v: u16,
30564 #[doc = "Video image rotation clockwise"]
30565 pub rotation: u16,
30566 #[doc = "Horizontal Field of view"]
30567 pub hfov: u16,
30568 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30569 pub stream_id: u8,
30570 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30571 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30572 pub camera_device_id: u8,
30573}
30574impl VIDEO_STREAM_STATUS_DATA {
30575 pub const ENCODED_LEN: usize = 20usize;
30576 pub const DEFAULT: Self = Self {
30577 framerate: 0.0_f32,
30578 bitrate: 0_u32,
30579 flags: VideoStreamStatusFlags::DEFAULT,
30580 resolution_h: 0_u16,
30581 resolution_v: 0_u16,
30582 rotation: 0_u16,
30583 hfov: 0_u16,
30584 stream_id: 0_u8,
30585 camera_device_id: 0_u8,
30586 };
30587 #[cfg(feature = "arbitrary")]
30588 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30589 use arbitrary::{Arbitrary, Unstructured};
30590 let mut buf = [0u8; 1024];
30591 rng.fill_bytes(&mut buf);
30592 let mut unstructured = Unstructured::new(&buf);
30593 Self::arbitrary(&mut unstructured).unwrap_or_default()
30594 }
30595}
30596impl Default for VIDEO_STREAM_STATUS_DATA {
30597 fn default() -> Self {
30598 Self::DEFAULT.clone()
30599 }
30600}
30601impl MessageData for VIDEO_STREAM_STATUS_DATA {
30602 type Message = MavMessage;
30603 const ID: u32 = 270u32;
30604 const NAME: &'static str = "VIDEO_STREAM_STATUS";
30605 const EXTRA_CRC: u8 = 59u8;
30606 const ENCODED_LEN: usize = 20usize;
30607 fn deser(
30608 _version: MavlinkVersion,
30609 __input: &[u8],
30610 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30611 let avail_len = __input.len();
30612 let mut payload_buf = [0; Self::ENCODED_LEN];
30613 let mut buf = if avail_len < Self::ENCODED_LEN {
30614 payload_buf[0..avail_len].copy_from_slice(__input);
30615 Bytes::new(&payload_buf)
30616 } else {
30617 Bytes::new(__input)
30618 };
30619 let mut __struct = Self::default();
30620 __struct.framerate = buf.get_f32_le();
30621 __struct.bitrate = buf.get_u32_le();
30622 let tmp = buf.get_u16_le();
30623 __struct.flags = VideoStreamStatusFlags::from_bits(
30624 tmp & VideoStreamStatusFlags::all().bits(),
30625 )
30626 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30627 flag_type: "VideoStreamStatusFlags",
30628 value: tmp as u32,
30629 })?;
30630 __struct.resolution_h = buf.get_u16_le();
30631 __struct.resolution_v = buf.get_u16_le();
30632 __struct.rotation = buf.get_u16_le();
30633 __struct.hfov = buf.get_u16_le();
30634 __struct.stream_id = buf.get_u8();
30635 __struct.camera_device_id = buf.get_u8();
30636 Ok(__struct)
30637 }
30638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30639 let mut __tmp = BytesMut::new(bytes);
30640 #[allow(clippy::absurd_extreme_comparisons)]
30641 #[allow(unused_comparisons)]
30642 if __tmp.remaining() < Self::ENCODED_LEN {
30643 panic!(
30644 "buffer is too small (need {} bytes, but got {})",
30645 Self::ENCODED_LEN,
30646 __tmp.remaining(),
30647 )
30648 }
30649 __tmp.put_f32_le(self.framerate);
30650 __tmp.put_u32_le(self.bitrate);
30651 __tmp.put_u16_le(self.flags.bits());
30652 __tmp.put_u16_le(self.resolution_h);
30653 __tmp.put_u16_le(self.resolution_v);
30654 __tmp.put_u16_le(self.rotation);
30655 __tmp.put_u16_le(self.hfov);
30656 __tmp.put_u8(self.stream_id);
30657 __tmp.put_u8(self.camera_device_id);
30658 if matches!(version, MavlinkVersion::V2) {
30659 let len = __tmp.len();
30660 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30661 } else {
30662 __tmp.len()
30663 }
30664 }
30665}
30666#[doc = "id: 102"]
30667#[doc = "Local position/attitude estimate from a vision source."]
30668#[derive(Debug, Clone, PartialEq)]
30669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30671pub struct VISION_POSITION_ESTIMATE_DATA {
30672 #[doc = "Timestamp (UNIX time or time since system boot)"]
30673 pub usec: u64,
30674 #[doc = "Local X position"]
30675 pub x: f32,
30676 #[doc = "Local Y position"]
30677 pub y: f32,
30678 #[doc = "Local Z position"]
30679 pub z: f32,
30680 #[doc = "Roll angle"]
30681 pub roll: f32,
30682 #[doc = "Pitch angle"]
30683 pub pitch: f32,
30684 #[doc = "Yaw angle"]
30685 pub yaw: f32,
30686 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30687 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30689 pub covariance: [f32; 21],
30690 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30691 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30692 pub reset_counter: u8,
30693}
30694impl VISION_POSITION_ESTIMATE_DATA {
30695 pub const ENCODED_LEN: usize = 117usize;
30696 pub const DEFAULT: Self = Self {
30697 usec: 0_u64,
30698 x: 0.0_f32,
30699 y: 0.0_f32,
30700 z: 0.0_f32,
30701 roll: 0.0_f32,
30702 pitch: 0.0_f32,
30703 yaw: 0.0_f32,
30704 covariance: [0.0_f32; 21usize],
30705 reset_counter: 0_u8,
30706 };
30707 #[cfg(feature = "arbitrary")]
30708 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30709 use arbitrary::{Arbitrary, Unstructured};
30710 let mut buf = [0u8; 1024];
30711 rng.fill_bytes(&mut buf);
30712 let mut unstructured = Unstructured::new(&buf);
30713 Self::arbitrary(&mut unstructured).unwrap_or_default()
30714 }
30715}
30716impl Default for VISION_POSITION_ESTIMATE_DATA {
30717 fn default() -> Self {
30718 Self::DEFAULT.clone()
30719 }
30720}
30721impl MessageData for VISION_POSITION_ESTIMATE_DATA {
30722 type Message = MavMessage;
30723 const ID: u32 = 102u32;
30724 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
30725 const EXTRA_CRC: u8 = 158u8;
30726 const ENCODED_LEN: usize = 117usize;
30727 fn deser(
30728 _version: MavlinkVersion,
30729 __input: &[u8],
30730 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30731 let avail_len = __input.len();
30732 let mut payload_buf = [0; Self::ENCODED_LEN];
30733 let mut buf = if avail_len < Self::ENCODED_LEN {
30734 payload_buf[0..avail_len].copy_from_slice(__input);
30735 Bytes::new(&payload_buf)
30736 } else {
30737 Bytes::new(__input)
30738 };
30739 let mut __struct = Self::default();
30740 __struct.usec = buf.get_u64_le();
30741 __struct.x = buf.get_f32_le();
30742 __struct.y = buf.get_f32_le();
30743 __struct.z = buf.get_f32_le();
30744 __struct.roll = buf.get_f32_le();
30745 __struct.pitch = buf.get_f32_le();
30746 __struct.yaw = buf.get_f32_le();
30747 for v in &mut __struct.covariance {
30748 let val = buf.get_f32_le();
30749 *v = val;
30750 }
30751 __struct.reset_counter = buf.get_u8();
30752 Ok(__struct)
30753 }
30754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30755 let mut __tmp = BytesMut::new(bytes);
30756 #[allow(clippy::absurd_extreme_comparisons)]
30757 #[allow(unused_comparisons)]
30758 if __tmp.remaining() < Self::ENCODED_LEN {
30759 panic!(
30760 "buffer is too small (need {} bytes, but got {})",
30761 Self::ENCODED_LEN,
30762 __tmp.remaining(),
30763 )
30764 }
30765 __tmp.put_u64_le(self.usec);
30766 __tmp.put_f32_le(self.x);
30767 __tmp.put_f32_le(self.y);
30768 __tmp.put_f32_le(self.z);
30769 __tmp.put_f32_le(self.roll);
30770 __tmp.put_f32_le(self.pitch);
30771 __tmp.put_f32_le(self.yaw);
30772 for val in &self.covariance {
30773 __tmp.put_f32_le(*val);
30774 }
30775 __tmp.put_u8(self.reset_counter);
30776 if matches!(version, MavlinkVersion::V2) {
30777 let len = __tmp.len();
30778 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30779 } else {
30780 __tmp.len()
30781 }
30782 }
30783}
30784#[doc = "id: 103"]
30785#[doc = "Speed estimate from a vision source."]
30786#[derive(Debug, Clone, PartialEq)]
30787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30789pub struct VISION_SPEED_ESTIMATE_DATA {
30790 #[doc = "Timestamp (UNIX time or time since system boot)"]
30791 pub usec: u64,
30792 #[doc = "Global X speed"]
30793 pub x: f32,
30794 #[doc = "Global Y speed"]
30795 pub y: f32,
30796 #[doc = "Global Z speed"]
30797 pub z: f32,
30798 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
30799 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30800 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30801 pub covariance: [f32; 9],
30802 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30803 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30804 pub reset_counter: u8,
30805}
30806impl VISION_SPEED_ESTIMATE_DATA {
30807 pub const ENCODED_LEN: usize = 57usize;
30808 pub const DEFAULT: Self = Self {
30809 usec: 0_u64,
30810 x: 0.0_f32,
30811 y: 0.0_f32,
30812 z: 0.0_f32,
30813 covariance: [0.0_f32; 9usize],
30814 reset_counter: 0_u8,
30815 };
30816 #[cfg(feature = "arbitrary")]
30817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30818 use arbitrary::{Arbitrary, Unstructured};
30819 let mut buf = [0u8; 1024];
30820 rng.fill_bytes(&mut buf);
30821 let mut unstructured = Unstructured::new(&buf);
30822 Self::arbitrary(&mut unstructured).unwrap_or_default()
30823 }
30824}
30825impl Default for VISION_SPEED_ESTIMATE_DATA {
30826 fn default() -> Self {
30827 Self::DEFAULT.clone()
30828 }
30829}
30830impl MessageData for VISION_SPEED_ESTIMATE_DATA {
30831 type Message = MavMessage;
30832 const ID: u32 = 103u32;
30833 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
30834 const EXTRA_CRC: u8 = 208u8;
30835 const ENCODED_LEN: usize = 57usize;
30836 fn deser(
30837 _version: MavlinkVersion,
30838 __input: &[u8],
30839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30840 let avail_len = __input.len();
30841 let mut payload_buf = [0; Self::ENCODED_LEN];
30842 let mut buf = if avail_len < Self::ENCODED_LEN {
30843 payload_buf[0..avail_len].copy_from_slice(__input);
30844 Bytes::new(&payload_buf)
30845 } else {
30846 Bytes::new(__input)
30847 };
30848 let mut __struct = Self::default();
30849 __struct.usec = buf.get_u64_le();
30850 __struct.x = buf.get_f32_le();
30851 __struct.y = buf.get_f32_le();
30852 __struct.z = buf.get_f32_le();
30853 for v in &mut __struct.covariance {
30854 let val = buf.get_f32_le();
30855 *v = val;
30856 }
30857 __struct.reset_counter = buf.get_u8();
30858 Ok(__struct)
30859 }
30860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30861 let mut __tmp = BytesMut::new(bytes);
30862 #[allow(clippy::absurd_extreme_comparisons)]
30863 #[allow(unused_comparisons)]
30864 if __tmp.remaining() < Self::ENCODED_LEN {
30865 panic!(
30866 "buffer is too small (need {} bytes, but got {})",
30867 Self::ENCODED_LEN,
30868 __tmp.remaining(),
30869 )
30870 }
30871 __tmp.put_u64_le(self.usec);
30872 __tmp.put_f32_le(self.x);
30873 __tmp.put_f32_le(self.y);
30874 __tmp.put_f32_le(self.z);
30875 for val in &self.covariance {
30876 __tmp.put_f32_le(*val);
30877 }
30878 __tmp.put_u8(self.reset_counter);
30879 if matches!(version, MavlinkVersion::V2) {
30880 let len = __tmp.len();
30881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30882 } else {
30883 __tmp.len()
30884 }
30885 }
30886}
30887#[doc = "id: 9000"]
30888#[doc = "Cumulative distance traveled for each reported wheel."]
30889#[derive(Debug, Clone, PartialEq)]
30890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30892pub struct WHEEL_DISTANCE_DATA {
30893 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
30894 pub time_usec: u64,
30895 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
30896 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30897 pub distance: [f64; 16],
30898 #[doc = "Number of wheels reported."]
30899 pub count: u8,
30900}
30901impl WHEEL_DISTANCE_DATA {
30902 pub const ENCODED_LEN: usize = 137usize;
30903 pub const DEFAULT: Self = Self {
30904 time_usec: 0_u64,
30905 distance: [0.0_f64; 16usize],
30906 count: 0_u8,
30907 };
30908 #[cfg(feature = "arbitrary")]
30909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30910 use arbitrary::{Arbitrary, Unstructured};
30911 let mut buf = [0u8; 1024];
30912 rng.fill_bytes(&mut buf);
30913 let mut unstructured = Unstructured::new(&buf);
30914 Self::arbitrary(&mut unstructured).unwrap_or_default()
30915 }
30916}
30917impl Default for WHEEL_DISTANCE_DATA {
30918 fn default() -> Self {
30919 Self::DEFAULT.clone()
30920 }
30921}
30922impl MessageData for WHEEL_DISTANCE_DATA {
30923 type Message = MavMessage;
30924 const ID: u32 = 9000u32;
30925 const NAME: &'static str = "WHEEL_DISTANCE";
30926 const EXTRA_CRC: u8 = 113u8;
30927 const ENCODED_LEN: usize = 137usize;
30928 fn deser(
30929 _version: MavlinkVersion,
30930 __input: &[u8],
30931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30932 let avail_len = __input.len();
30933 let mut payload_buf = [0; Self::ENCODED_LEN];
30934 let mut buf = if avail_len < Self::ENCODED_LEN {
30935 payload_buf[0..avail_len].copy_from_slice(__input);
30936 Bytes::new(&payload_buf)
30937 } else {
30938 Bytes::new(__input)
30939 };
30940 let mut __struct = Self::default();
30941 __struct.time_usec = buf.get_u64_le();
30942 for v in &mut __struct.distance {
30943 let val = buf.get_f64_le();
30944 *v = val;
30945 }
30946 __struct.count = buf.get_u8();
30947 Ok(__struct)
30948 }
30949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30950 let mut __tmp = BytesMut::new(bytes);
30951 #[allow(clippy::absurd_extreme_comparisons)]
30952 #[allow(unused_comparisons)]
30953 if __tmp.remaining() < Self::ENCODED_LEN {
30954 panic!(
30955 "buffer is too small (need {} bytes, but got {})",
30956 Self::ENCODED_LEN,
30957 __tmp.remaining(),
30958 )
30959 }
30960 __tmp.put_u64_le(self.time_usec);
30961 for val in &self.distance {
30962 __tmp.put_f64_le(*val);
30963 }
30964 __tmp.put_u8(self.count);
30965 if matches!(version, MavlinkVersion::V2) {
30966 let len = __tmp.len();
30967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30968 } else {
30969 __tmp.len()
30970 }
30971 }
30972}
30973#[doc = "id: 299"]
30974#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
30975#[derive(Debug, Clone, PartialEq)]
30976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30978pub struct WIFI_CONFIG_AP_DATA {
30979 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
30980 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30981 pub ssid: [u8; 32],
30982 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
30983 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30984 pub password: [u8; 64],
30985 #[doc = "WiFi Mode."]
30986 #[cfg_attr(feature = "serde", serde(default))]
30987 pub mode: WifiConfigApMode,
30988 #[doc = "Message acceptance response (sent back to GS)."]
30989 #[cfg_attr(feature = "serde", serde(default))]
30990 pub response: WifiConfigApResponse,
30991}
30992impl WIFI_CONFIG_AP_DATA {
30993 pub const ENCODED_LEN: usize = 98usize;
30994 pub const DEFAULT: Self = Self {
30995 ssid: [0_u8; 32usize],
30996 password: [0_u8; 64usize],
30997 mode: WifiConfigApMode::DEFAULT,
30998 response: WifiConfigApResponse::DEFAULT,
30999 };
31000 #[cfg(feature = "arbitrary")]
31001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31002 use arbitrary::{Arbitrary, Unstructured};
31003 let mut buf = [0u8; 1024];
31004 rng.fill_bytes(&mut buf);
31005 let mut unstructured = Unstructured::new(&buf);
31006 Self::arbitrary(&mut unstructured).unwrap_or_default()
31007 }
31008}
31009impl Default for WIFI_CONFIG_AP_DATA {
31010 fn default() -> Self {
31011 Self::DEFAULT.clone()
31012 }
31013}
31014impl MessageData for WIFI_CONFIG_AP_DATA {
31015 type Message = MavMessage;
31016 const ID: u32 = 299u32;
31017 const NAME: &'static str = "WIFI_CONFIG_AP";
31018 const EXTRA_CRC: u8 = 19u8;
31019 const ENCODED_LEN: usize = 98usize;
31020 fn deser(
31021 _version: MavlinkVersion,
31022 __input: &[u8],
31023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31024 let avail_len = __input.len();
31025 let mut payload_buf = [0; Self::ENCODED_LEN];
31026 let mut buf = if avail_len < Self::ENCODED_LEN {
31027 payload_buf[0..avail_len].copy_from_slice(__input);
31028 Bytes::new(&payload_buf)
31029 } else {
31030 Bytes::new(__input)
31031 };
31032 let mut __struct = Self::default();
31033 for v in &mut __struct.ssid {
31034 let val = buf.get_u8();
31035 *v = val;
31036 }
31037 for v in &mut __struct.password {
31038 let val = buf.get_u8();
31039 *v = val;
31040 }
31041 let tmp = buf.get_i8();
31042 __struct.mode =
31043 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31044 enum_type: "WifiConfigApMode",
31045 value: tmp as u32,
31046 })?;
31047 let tmp = buf.get_i8();
31048 __struct.response =
31049 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31050 enum_type: "WifiConfigApResponse",
31051 value: tmp as u32,
31052 })?;
31053 Ok(__struct)
31054 }
31055 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31056 let mut __tmp = BytesMut::new(bytes);
31057 #[allow(clippy::absurd_extreme_comparisons)]
31058 #[allow(unused_comparisons)]
31059 if __tmp.remaining() < Self::ENCODED_LEN {
31060 panic!(
31061 "buffer is too small (need {} bytes, but got {})",
31062 Self::ENCODED_LEN,
31063 __tmp.remaining(),
31064 )
31065 }
31066 for val in &self.ssid {
31067 __tmp.put_u8(*val);
31068 }
31069 for val in &self.password {
31070 __tmp.put_u8(*val);
31071 }
31072 __tmp.put_i8(self.mode as i8);
31073 __tmp.put_i8(self.response as i8);
31074 if matches!(version, MavlinkVersion::V2) {
31075 let len = __tmp.len();
31076 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31077 } else {
31078 __tmp.len()
31079 }
31080 }
31081}
31082#[doc = "id: 9005"]
31083#[doc = "Winch status."]
31084#[derive(Debug, Clone, PartialEq)]
31085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31087pub struct WINCH_STATUS_DATA {
31088 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31089 pub time_usec: u64,
31090 #[doc = "Length of line released. NaN if unknown"]
31091 pub line_length: f32,
31092 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31093 pub speed: f32,
31094 #[doc = "Tension on the line. NaN if unknown"]
31095 pub tension: f32,
31096 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31097 pub voltage: f32,
31098 #[doc = "Current draw from the winch. NaN if unknown"]
31099 pub current: f32,
31100 #[doc = "Status flags"]
31101 pub status: MavWinchStatusFlag,
31102 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31103 pub temperature: i16,
31104}
31105impl WINCH_STATUS_DATA {
31106 pub const ENCODED_LEN: usize = 34usize;
31107 pub const DEFAULT: Self = Self {
31108 time_usec: 0_u64,
31109 line_length: 0.0_f32,
31110 speed: 0.0_f32,
31111 tension: 0.0_f32,
31112 voltage: 0.0_f32,
31113 current: 0.0_f32,
31114 status: MavWinchStatusFlag::DEFAULT,
31115 temperature: 0_i16,
31116 };
31117 #[cfg(feature = "arbitrary")]
31118 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31119 use arbitrary::{Arbitrary, Unstructured};
31120 let mut buf = [0u8; 1024];
31121 rng.fill_bytes(&mut buf);
31122 let mut unstructured = Unstructured::new(&buf);
31123 Self::arbitrary(&mut unstructured).unwrap_or_default()
31124 }
31125}
31126impl Default for WINCH_STATUS_DATA {
31127 fn default() -> Self {
31128 Self::DEFAULT.clone()
31129 }
31130}
31131impl MessageData for WINCH_STATUS_DATA {
31132 type Message = MavMessage;
31133 const ID: u32 = 9005u32;
31134 const NAME: &'static str = "WINCH_STATUS";
31135 const EXTRA_CRC: u8 = 117u8;
31136 const ENCODED_LEN: usize = 34usize;
31137 fn deser(
31138 _version: MavlinkVersion,
31139 __input: &[u8],
31140 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31141 let avail_len = __input.len();
31142 let mut payload_buf = [0; Self::ENCODED_LEN];
31143 let mut buf = if avail_len < Self::ENCODED_LEN {
31144 payload_buf[0..avail_len].copy_from_slice(__input);
31145 Bytes::new(&payload_buf)
31146 } else {
31147 Bytes::new(__input)
31148 };
31149 let mut __struct = Self::default();
31150 __struct.time_usec = buf.get_u64_le();
31151 __struct.line_length = buf.get_f32_le();
31152 __struct.speed = buf.get_f32_le();
31153 __struct.tension = buf.get_f32_le();
31154 __struct.voltage = buf.get_f32_le();
31155 __struct.current = buf.get_f32_le();
31156 let tmp = buf.get_u32_le();
31157 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31158 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31159 flag_type: "MavWinchStatusFlag",
31160 value: tmp as u32,
31161 })?;
31162 __struct.temperature = buf.get_i16_le();
31163 Ok(__struct)
31164 }
31165 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31166 let mut __tmp = BytesMut::new(bytes);
31167 #[allow(clippy::absurd_extreme_comparisons)]
31168 #[allow(unused_comparisons)]
31169 if __tmp.remaining() < Self::ENCODED_LEN {
31170 panic!(
31171 "buffer is too small (need {} bytes, but got {})",
31172 Self::ENCODED_LEN,
31173 __tmp.remaining(),
31174 )
31175 }
31176 __tmp.put_u64_le(self.time_usec);
31177 __tmp.put_f32_le(self.line_length);
31178 __tmp.put_f32_le(self.speed);
31179 __tmp.put_f32_le(self.tension);
31180 __tmp.put_f32_le(self.voltage);
31181 __tmp.put_f32_le(self.current);
31182 __tmp.put_u32_le(self.status.bits());
31183 __tmp.put_i16_le(self.temperature);
31184 if matches!(version, MavlinkVersion::V2) {
31185 let len = __tmp.len();
31186 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31187 } else {
31188 __tmp.len()
31189 }
31190 }
31191}
31192#[doc = "id: 231"]
31193#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31194#[derive(Debug, Clone, PartialEq)]
31195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31197pub struct WIND_COV_DATA {
31198 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31199 pub time_usec: u64,
31200 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31201 pub wind_x: f32,
31202 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31203 pub wind_y: f32,
31204 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31205 pub wind_z: f32,
31206 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31207 pub var_horiz: f32,
31208 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31209 pub var_vert: f32,
31210 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31211 pub wind_alt: f32,
31212 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31213 pub horiz_accuracy: f32,
31214 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31215 pub vert_accuracy: f32,
31216}
31217impl WIND_COV_DATA {
31218 pub const ENCODED_LEN: usize = 40usize;
31219 pub const DEFAULT: Self = Self {
31220 time_usec: 0_u64,
31221 wind_x: 0.0_f32,
31222 wind_y: 0.0_f32,
31223 wind_z: 0.0_f32,
31224 var_horiz: 0.0_f32,
31225 var_vert: 0.0_f32,
31226 wind_alt: 0.0_f32,
31227 horiz_accuracy: 0.0_f32,
31228 vert_accuracy: 0.0_f32,
31229 };
31230 #[cfg(feature = "arbitrary")]
31231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31232 use arbitrary::{Arbitrary, Unstructured};
31233 let mut buf = [0u8; 1024];
31234 rng.fill_bytes(&mut buf);
31235 let mut unstructured = Unstructured::new(&buf);
31236 Self::arbitrary(&mut unstructured).unwrap_or_default()
31237 }
31238}
31239impl Default for WIND_COV_DATA {
31240 fn default() -> Self {
31241 Self::DEFAULT.clone()
31242 }
31243}
31244impl MessageData for WIND_COV_DATA {
31245 type Message = MavMessage;
31246 const ID: u32 = 231u32;
31247 const NAME: &'static str = "WIND_COV";
31248 const EXTRA_CRC: u8 = 105u8;
31249 const ENCODED_LEN: usize = 40usize;
31250 fn deser(
31251 _version: MavlinkVersion,
31252 __input: &[u8],
31253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31254 let avail_len = __input.len();
31255 let mut payload_buf = [0; Self::ENCODED_LEN];
31256 let mut buf = if avail_len < Self::ENCODED_LEN {
31257 payload_buf[0..avail_len].copy_from_slice(__input);
31258 Bytes::new(&payload_buf)
31259 } else {
31260 Bytes::new(__input)
31261 };
31262 let mut __struct = Self::default();
31263 __struct.time_usec = buf.get_u64_le();
31264 __struct.wind_x = buf.get_f32_le();
31265 __struct.wind_y = buf.get_f32_le();
31266 __struct.wind_z = buf.get_f32_le();
31267 __struct.var_horiz = buf.get_f32_le();
31268 __struct.var_vert = buf.get_f32_le();
31269 __struct.wind_alt = buf.get_f32_le();
31270 __struct.horiz_accuracy = buf.get_f32_le();
31271 __struct.vert_accuracy = buf.get_f32_le();
31272 Ok(__struct)
31273 }
31274 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31275 let mut __tmp = BytesMut::new(bytes);
31276 #[allow(clippy::absurd_extreme_comparisons)]
31277 #[allow(unused_comparisons)]
31278 if __tmp.remaining() < Self::ENCODED_LEN {
31279 panic!(
31280 "buffer is too small (need {} bytes, but got {})",
31281 Self::ENCODED_LEN,
31282 __tmp.remaining(),
31283 )
31284 }
31285 __tmp.put_u64_le(self.time_usec);
31286 __tmp.put_f32_le(self.wind_x);
31287 __tmp.put_f32_le(self.wind_y);
31288 __tmp.put_f32_le(self.wind_z);
31289 __tmp.put_f32_le(self.var_horiz);
31290 __tmp.put_f32_le(self.var_vert);
31291 __tmp.put_f32_le(self.wind_alt);
31292 __tmp.put_f32_le(self.horiz_accuracy);
31293 __tmp.put_f32_le(self.vert_accuracy);
31294 if matches!(version, MavlinkVersion::V2) {
31295 let len = __tmp.len();
31296 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31297 } else {
31298 __tmp.len()
31299 }
31300 }
31301}
31302#[derive(Clone, PartialEq, Debug)]
31303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31304#[cfg_attr(feature = "serde", serde(tag = "type"))]
31305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31306#[repr(u32)]
31307pub enum MavMessage {
31308 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31309 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31310 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31311 AIS_VESSEL(AIS_VESSEL_DATA),
31312 ALTITUDE(ALTITUDE_DATA),
31313 ATTITUDE(ATTITUDE_DATA),
31314 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31315 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31316 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31317 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31318 AUTH_KEY(AUTH_KEY_DATA),
31319 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31320 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31321 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31322 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31323 BATTERY_INFO(BATTERY_INFO_DATA),
31324 BATTERY_STATUS(BATTERY_STATUS_DATA),
31325 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31326 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31327 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31328 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31329 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31330 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31331 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31332 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31333 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31334 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31335 CANFD_FRAME(CANFD_FRAME_DATA),
31336 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31337 CAN_FRAME(CAN_FRAME_DATA),
31338 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31339 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31340 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31341 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31342 COLLISION(COLLISION_DATA),
31343 COMMAND_ACK(COMMAND_ACK_DATA),
31344 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31345 COMMAND_INT(COMMAND_INT_DATA),
31346 COMMAND_LONG(COMMAND_LONG_DATA),
31347 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31348 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31349 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31350 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31351 CUBEPILOT_FIRMWARE_UPDATE_RESP(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA),
31352 CUBEPILOT_FIRMWARE_UPDATE_START(CUBEPILOT_FIRMWARE_UPDATE_START_DATA),
31353 CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA),
31354 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31355 CURRENT_MODE(CURRENT_MODE_DATA),
31356 DATA_STREAM(DATA_STREAM_DATA),
31357 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31358 DEBUG(DEBUG_DATA),
31359 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31360 DEBUG_VECT(DEBUG_VECT_DATA),
31361 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31362 EFI_STATUS(EFI_STATUS_DATA),
31363 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31364 ESC_INFO(ESC_INFO_DATA),
31365 ESC_STATUS(ESC_STATUS_DATA),
31366 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31367 EVENT(EVENT_DATA),
31368 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31369 FENCE_STATUS(FENCE_STATUS_DATA),
31370 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31371 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31372 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31373 FUEL_STATUS(FUEL_STATUS_DATA),
31374 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31375 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31376 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31377 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31378 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31379 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31380 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31381 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
31382 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
31383 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
31384 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
31385 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
31386 GPS2_RAW(GPS2_RAW_DATA),
31387 GPS2_RTK(GPS2_RTK_DATA),
31388 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
31389 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
31390 GPS_INPUT(GPS_INPUT_DATA),
31391 GPS_RAW_INT(GPS_RAW_INT_DATA),
31392 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
31393 GPS_RTK(GPS_RTK_DATA),
31394 GPS_STATUS(GPS_STATUS_DATA),
31395 HEARTBEAT(HEARTBEAT_DATA),
31396 HERELINK_TELEM(HERELINK_TELEM_DATA),
31397 HERELINK_VIDEO_STREAM_INFORMATION(HERELINK_VIDEO_STREAM_INFORMATION_DATA),
31398 HIGHRES_IMU(HIGHRES_IMU_DATA),
31399 HIGH_LATENCY(HIGH_LATENCY_DATA),
31400 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
31401 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
31402 HIL_CONTROLS(HIL_CONTROLS_DATA),
31403 HIL_GPS(HIL_GPS_DATA),
31404 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
31405 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
31406 HIL_SENSOR(HIL_SENSOR_DATA),
31407 HIL_STATE(HIL_STATE_DATA),
31408 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
31409 HOME_POSITION(HOME_POSITION_DATA),
31410 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
31411 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
31412 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
31413 LANDING_TARGET(LANDING_TARGET_DATA),
31414 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
31415 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
31416 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
31417 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
31418 LOGGING_ACK(LOGGING_ACK_DATA),
31419 LOGGING_DATA(LOGGING_DATA_DATA),
31420 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
31421 LOG_DATA(LOG_DATA_DATA),
31422 LOG_ENTRY(LOG_ENTRY_DATA),
31423 LOG_ERASE(LOG_ERASE_DATA),
31424 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
31425 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
31426 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
31427 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
31428 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
31429 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
31430 MEMORY_VECT(MEMORY_VECT_DATA),
31431 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
31432 MISSION_ACK(MISSION_ACK_DATA),
31433 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
31434 MISSION_COUNT(MISSION_COUNT_DATA),
31435 MISSION_CURRENT(MISSION_CURRENT_DATA),
31436 MISSION_ITEM(MISSION_ITEM_DATA),
31437 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
31438 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
31439 MISSION_REQUEST(MISSION_REQUEST_DATA),
31440 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
31441 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
31442 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
31443 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
31444 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
31445 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
31446 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
31447 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
31448 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
31449 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
31450 ODOMETRY(ODOMETRY_DATA),
31451 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
31452 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
31453 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
31454 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
31455 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
31456 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
31457 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
31458 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
31459 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
31460 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
31461 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
31462 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
31463 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
31464 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
31465 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
31466 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
31467 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
31468 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
31469 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
31470 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
31471 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
31472 PARAM_SET(PARAM_SET_DATA),
31473 PARAM_VALUE(PARAM_VALUE_DATA),
31474 PING(PING_DATA),
31475 PLAY_TUNE(PLAY_TUNE_DATA),
31476 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
31477 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
31478 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
31479 POWER_STATUS(POWER_STATUS_DATA),
31480 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
31481 RADIO_STATUS(RADIO_STATUS_DATA),
31482 RAW_IMU(RAW_IMU_DATA),
31483 RAW_PRESSURE(RAW_PRESSURE_DATA),
31484 RAW_RPM(RAW_RPM_DATA),
31485 RC_CHANNELS(RC_CHANNELS_DATA),
31486 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
31487 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
31488 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
31489 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
31490 REQUEST_EVENT(REQUEST_EVENT_DATA),
31491 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
31492 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
31493 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
31494 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
31495 SCALED_IMU(SCALED_IMU_DATA),
31496 SCALED_IMU2(SCALED_IMU2_DATA),
31497 SCALED_IMU3(SCALED_IMU3_DATA),
31498 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
31499 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
31500 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
31501 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
31502 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
31503 SETUP_SIGNING(SETUP_SIGNING_DATA),
31504 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
31505 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
31506 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
31507 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
31508 SET_MODE(SET_MODE_DATA),
31509 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
31510 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
31511 SIM_STATE(SIM_STATE_DATA),
31512 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
31513 STATUSTEXT(STATUSTEXT_DATA),
31514 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
31515 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
31516 SYSTEM_TIME(SYSTEM_TIME_DATA),
31517 SYS_STATUS(SYS_STATUS_DATA),
31518 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
31519 TERRAIN_DATA(TERRAIN_DATA_DATA),
31520 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
31521 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
31522 TIMESYNC(TIMESYNC_DATA),
31523 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
31524 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
31525 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
31526 TUNNEL(TUNNEL_DATA),
31527 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
31528 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
31529 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
31530 V2_EXTENSION(V2_EXTENSION_DATA),
31531 VFR_HUD(VFR_HUD_DATA),
31532 VIBRATION(VIBRATION_DATA),
31533 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
31534 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
31535 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
31536 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
31537 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
31538 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
31539 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
31540 WINCH_STATUS(WINCH_STATUS_DATA),
31541 WIND_COV(WIND_COV_DATA),
31542}
31543impl MavMessage {
31544 pub const fn all_ids() -> &'static [u32] {
31545 &[
31546 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
31547 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
31548 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
31549 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
31550 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
31551 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
31552 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
31553 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
31554 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
31555 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
31556 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
31557 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
31558 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
31559 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
31560 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
31561 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
31562 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
31563 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
31564 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
31565 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
31566 12915u32, 12918u32, 12919u32, 12920u32, 50001u32, 50002u32, 50003u32, 50004u32,
31567 50005u32,
31568 ]
31569 }
31570}
31571impl Message for MavMessage {
31572 fn parse(
31573 version: MavlinkVersion,
31574 id: u32,
31575 payload: &[u8],
31576 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31577 match id {
31578 ACTUATOR_CONTROL_TARGET_DATA::ID => {
31579 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
31580 .map(Self::ACTUATOR_CONTROL_TARGET)
31581 }
31582 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
31583 .map(Self::ACTUATOR_OUTPUT_STATUS),
31584 ADSB_VEHICLE_DATA::ID => {
31585 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
31586 }
31587 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
31588 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
31589 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
31590 ATTITUDE_QUATERNION_DATA::ID => {
31591 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
31592 }
31593 ATTITUDE_QUATERNION_COV_DATA::ID => {
31594 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
31595 .map(Self::ATTITUDE_QUATERNION_COV)
31596 }
31597 ATTITUDE_TARGET_DATA::ID => {
31598 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
31599 }
31600 ATT_POS_MOCAP_DATA::ID => {
31601 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
31602 }
31603 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
31604 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
31605 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
31606 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
31607 }
31608 AUTOPILOT_VERSION_DATA::ID => {
31609 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
31610 }
31611 AVAILABLE_MODES_DATA::ID => {
31612 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
31613 }
31614 AVAILABLE_MODES_MONITOR_DATA::ID => {
31615 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
31616 .map(Self::AVAILABLE_MODES_MONITOR)
31617 }
31618 BATTERY_INFO_DATA::ID => {
31619 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
31620 }
31621 BATTERY_STATUS_DATA::ID => {
31622 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
31623 }
31624 BUTTON_CHANGE_DATA::ID => {
31625 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
31626 }
31627 CAMERA_CAPTURE_STATUS_DATA::ID => {
31628 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
31629 }
31630 CAMERA_FOV_STATUS_DATA::ID => {
31631 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
31632 }
31633 CAMERA_IMAGE_CAPTURED_DATA::ID => {
31634 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
31635 }
31636 CAMERA_INFORMATION_DATA::ID => {
31637 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
31638 }
31639 CAMERA_SETTINGS_DATA::ID => {
31640 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
31641 }
31642 CAMERA_THERMAL_RANGE_DATA::ID => {
31643 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
31644 }
31645 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
31646 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
31647 .map(Self::CAMERA_TRACKING_GEO_STATUS)
31648 }
31649 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
31650 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
31651 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
31652 }
31653 CAMERA_TRIGGER_DATA::ID => {
31654 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
31655 }
31656 CANFD_FRAME_DATA::ID => {
31657 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
31658 }
31659 CAN_FILTER_MODIFY_DATA::ID => {
31660 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
31661 }
31662 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
31663 CELLULAR_CONFIG_DATA::ID => {
31664 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
31665 }
31666 CELLULAR_STATUS_DATA::ID => {
31667 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
31668 }
31669 CHANGE_OPERATOR_CONTROL_DATA::ID => {
31670 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
31671 .map(Self::CHANGE_OPERATOR_CONTROL)
31672 }
31673 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
31674 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
31675 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
31676 }
31677 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
31678 COMMAND_ACK_DATA::ID => {
31679 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
31680 }
31681 COMMAND_CANCEL_DATA::ID => {
31682 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
31683 }
31684 COMMAND_INT_DATA::ID => {
31685 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
31686 }
31687 COMMAND_LONG_DATA::ID => {
31688 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
31689 }
31690 COMPONENT_INFORMATION_DATA::ID => {
31691 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
31692 }
31693 COMPONENT_INFORMATION_BASIC_DATA::ID => {
31694 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
31695 .map(Self::COMPONENT_INFORMATION_BASIC)
31696 }
31697 COMPONENT_METADATA_DATA::ID => {
31698 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
31699 }
31700 CONTROL_SYSTEM_STATE_DATA::ID => {
31701 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
31702 }
31703 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
31704 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::deser(version, payload)
31705 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP)
31706 }
31707 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
31708 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::deser(version, payload)
31709 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_START)
31710 }
31711 CUBEPILOT_RAW_RC_DATA::ID => {
31712 CUBEPILOT_RAW_RC_DATA::deser(version, payload).map(Self::CUBEPILOT_RAW_RC)
31713 }
31714 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
31715 .map(Self::CURRENT_EVENT_SEQUENCE),
31716 CURRENT_MODE_DATA::ID => {
31717 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
31718 }
31719 DATA_STREAM_DATA::ID => {
31720 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
31721 }
31722 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
31723 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
31724 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
31725 }
31726 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
31727 DEBUG_FLOAT_ARRAY_DATA::ID => {
31728 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
31729 }
31730 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
31731 DISTANCE_SENSOR_DATA::ID => {
31732 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
31733 }
31734 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
31735 ENCAPSULATED_DATA_DATA::ID => {
31736 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
31737 }
31738 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
31739 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
31740 ESTIMATOR_STATUS_DATA::ID => {
31741 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
31742 }
31743 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
31744 EXTENDED_SYS_STATE_DATA::ID => {
31745 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
31746 }
31747 FENCE_STATUS_DATA::ID => {
31748 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
31749 }
31750 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
31751 .map(Self::FILE_TRANSFER_PROTOCOL),
31752 FLIGHT_INFORMATION_DATA::ID => {
31753 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
31754 }
31755 FOLLOW_TARGET_DATA::ID => {
31756 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
31757 }
31758 FUEL_STATUS_DATA::ID => {
31759 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
31760 }
31761 GENERATOR_STATUS_DATA::ID => {
31762 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
31763 }
31764 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
31765 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
31766 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
31767 }
31768 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
31769 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
31770 .map(Self::GIMBAL_DEVICE_INFORMATION)
31771 }
31772 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
31773 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
31774 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
31775 }
31776 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
31777 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
31778 .map(Self::GIMBAL_MANAGER_INFORMATION)
31779 }
31780 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
31781 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
31782 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
31783 }
31784 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
31785 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
31786 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
31787 }
31788 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
31789 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
31790 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
31791 }
31792 GIMBAL_MANAGER_STATUS_DATA::ID => {
31793 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
31794 }
31795 GLOBAL_POSITION_INT_DATA::ID => {
31796 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
31797 }
31798 GLOBAL_POSITION_INT_COV_DATA::ID => {
31799 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
31800 .map(Self::GLOBAL_POSITION_INT_COV)
31801 }
31802 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
31803 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
31804 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
31805 }
31806 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
31807 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
31808 GPS_GLOBAL_ORIGIN_DATA::ID => {
31809 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
31810 }
31811 GPS_INJECT_DATA_DATA::ID => {
31812 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
31813 }
31814 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
31815 GPS_RAW_INT_DATA::ID => {
31816 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
31817 }
31818 GPS_RTCM_DATA_DATA::ID => {
31819 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
31820 }
31821 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
31822 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
31823 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
31824 HERELINK_TELEM_DATA::ID => {
31825 HERELINK_TELEM_DATA::deser(version, payload).map(Self::HERELINK_TELEM)
31826 }
31827 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
31828 HERELINK_VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
31829 .map(Self::HERELINK_VIDEO_STREAM_INFORMATION)
31830 }
31831 HIGHRES_IMU_DATA::ID => {
31832 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
31833 }
31834 HIGH_LATENCY_DATA::ID => {
31835 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
31836 }
31837 HIGH_LATENCY2_DATA::ID => {
31838 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
31839 }
31840 HIL_ACTUATOR_CONTROLS_DATA::ID => {
31841 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
31842 }
31843 HIL_CONTROLS_DATA::ID => {
31844 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
31845 }
31846 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
31847 HIL_OPTICAL_FLOW_DATA::ID => {
31848 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
31849 }
31850 HIL_RC_INPUTS_RAW_DATA::ID => {
31851 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
31852 }
31853 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
31854 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
31855 HIL_STATE_QUATERNION_DATA::ID => {
31856 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
31857 }
31858 HOME_POSITION_DATA::ID => {
31859 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
31860 }
31861 HYGROMETER_SENSOR_DATA::ID => {
31862 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
31863 }
31864 ILLUMINATOR_STATUS_DATA::ID => {
31865 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
31866 }
31867 ISBD_LINK_STATUS_DATA::ID => {
31868 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
31869 }
31870 LANDING_TARGET_DATA::ID => {
31871 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
31872 }
31873 LINK_NODE_STATUS_DATA::ID => {
31874 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
31875 }
31876 LOCAL_POSITION_NED_DATA::ID => {
31877 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
31878 }
31879 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
31880 .map(Self::LOCAL_POSITION_NED_COV),
31881 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
31882 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
31883 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
31884 }
31885 LOGGING_ACK_DATA::ID => {
31886 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
31887 }
31888 LOGGING_DATA_DATA::ID => {
31889 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
31890 }
31891 LOGGING_DATA_ACKED_DATA::ID => {
31892 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
31893 }
31894 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
31895 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
31896 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
31897 LOG_REQUEST_DATA_DATA::ID => {
31898 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
31899 }
31900 LOG_REQUEST_END_DATA::ID => {
31901 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
31902 }
31903 LOG_REQUEST_LIST_DATA::ID => {
31904 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
31905 }
31906 MAG_CAL_REPORT_DATA::ID => {
31907 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
31908 }
31909 MANUAL_CONTROL_DATA::ID => {
31910 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
31911 }
31912 MANUAL_SETPOINT_DATA::ID => {
31913 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
31914 }
31915 MEMORY_VECT_DATA::ID => {
31916 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
31917 }
31918 MESSAGE_INTERVAL_DATA::ID => {
31919 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
31920 }
31921 MISSION_ACK_DATA::ID => {
31922 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
31923 }
31924 MISSION_CLEAR_ALL_DATA::ID => {
31925 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
31926 }
31927 MISSION_COUNT_DATA::ID => {
31928 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
31929 }
31930 MISSION_CURRENT_DATA::ID => {
31931 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
31932 }
31933 MISSION_ITEM_DATA::ID => {
31934 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
31935 }
31936 MISSION_ITEM_INT_DATA::ID => {
31937 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
31938 }
31939 MISSION_ITEM_REACHED_DATA::ID => {
31940 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
31941 }
31942 MISSION_REQUEST_DATA::ID => {
31943 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
31944 }
31945 MISSION_REQUEST_INT_DATA::ID => {
31946 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
31947 }
31948 MISSION_REQUEST_LIST_DATA::ID => {
31949 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
31950 }
31951 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
31952 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
31953 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
31954 }
31955 MISSION_SET_CURRENT_DATA::ID => {
31956 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
31957 }
31958 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
31959 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
31960 .map(Self::MISSION_WRITE_PARTIAL_LIST)
31961 }
31962 MOUNT_ORIENTATION_DATA::ID => {
31963 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
31964 }
31965 NAMED_VALUE_FLOAT_DATA::ID => {
31966 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
31967 }
31968 NAMED_VALUE_INT_DATA::ID => {
31969 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
31970 }
31971 NAV_CONTROLLER_OUTPUT_DATA::ID => {
31972 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
31973 }
31974 OBSTACLE_DISTANCE_DATA::ID => {
31975 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
31976 }
31977 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
31978 ONBOARD_COMPUTER_STATUS_DATA::ID => {
31979 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
31980 .map(Self::ONBOARD_COMPUTER_STATUS)
31981 }
31982 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
31983 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
31984 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
31985 }
31986 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
31987 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
31988 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
31989 }
31990 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
31991 .map(Self::OPEN_DRONE_ID_BASIC_ID),
31992 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
31993 .map(Self::OPEN_DRONE_ID_LOCATION),
31994 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
31995 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
31996 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
31997 }
31998 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
31999 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
32000 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
32001 }
32002 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
32003 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
32004 }
32005 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
32006 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
32007 }
32008 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
32009 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
32010 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
32011 }
32012 OPTICAL_FLOW_DATA::ID => {
32013 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
32014 }
32015 OPTICAL_FLOW_RAD_DATA::ID => {
32016 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
32017 }
32018 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
32019 .map(Self::ORBIT_EXECUTION_STATUS),
32020 PARAM_EXT_ACK_DATA::ID => {
32021 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
32022 }
32023 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
32024 .map(Self::PARAM_EXT_REQUEST_LIST),
32025 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
32026 .map(Self::PARAM_EXT_REQUEST_READ),
32027 PARAM_EXT_SET_DATA::ID => {
32028 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
32029 }
32030 PARAM_EXT_VALUE_DATA::ID => {
32031 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
32032 }
32033 PARAM_MAP_RC_DATA::ID => {
32034 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
32035 }
32036 PARAM_REQUEST_LIST_DATA::ID => {
32037 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
32038 }
32039 PARAM_REQUEST_READ_DATA::ID => {
32040 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
32041 }
32042 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
32043 PARAM_VALUE_DATA::ID => {
32044 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
32045 }
32046 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
32047 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
32048 PLAY_TUNE_V2_DATA::ID => {
32049 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
32050 }
32051 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32052 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32053 .map(Self::POSITION_TARGET_GLOBAL_INT)
32054 }
32055 POSITION_TARGET_LOCAL_NED_DATA::ID => {
32056 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32057 .map(Self::POSITION_TARGET_LOCAL_NED)
32058 }
32059 POWER_STATUS_DATA::ID => {
32060 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
32061 }
32062 PROTOCOL_VERSION_DATA::ID => {
32063 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
32064 }
32065 RADIO_STATUS_DATA::ID => {
32066 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
32067 }
32068 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
32069 RAW_PRESSURE_DATA::ID => {
32070 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
32071 }
32072 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
32073 RC_CHANNELS_DATA::ID => {
32074 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
32075 }
32076 RC_CHANNELS_OVERRIDE_DATA::ID => {
32077 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
32078 }
32079 RC_CHANNELS_RAW_DATA::ID => {
32080 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
32081 }
32082 RC_CHANNELS_SCALED_DATA::ID => {
32083 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
32084 }
32085 REQUEST_DATA_STREAM_DATA::ID => {
32086 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
32087 }
32088 REQUEST_EVENT_DATA::ID => {
32089 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
32090 }
32091 RESOURCE_REQUEST_DATA::ID => {
32092 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
32093 }
32094 RESPONSE_EVENT_ERROR_DATA::ID => {
32095 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
32096 }
32097 SAFETY_ALLOWED_AREA_DATA::ID => {
32098 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
32099 }
32100 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
32101 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
32102 .map(Self::SAFETY_SET_ALLOWED_AREA)
32103 }
32104 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
32105 SCALED_IMU2_DATA::ID => {
32106 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
32107 }
32108 SCALED_IMU3_DATA::ID => {
32109 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
32110 }
32111 SCALED_PRESSURE_DATA::ID => {
32112 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
32113 }
32114 SCALED_PRESSURE2_DATA::ID => {
32115 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
32116 }
32117 SCALED_PRESSURE3_DATA::ID => {
32118 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
32119 }
32120 SERIAL_CONTROL_DATA::ID => {
32121 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
32122 }
32123 SERVO_OUTPUT_RAW_DATA::ID => {
32124 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
32125 }
32126 SETUP_SIGNING_DATA::ID => {
32127 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
32128 }
32129 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
32130 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32131 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
32132 }
32133 SET_ATTITUDE_TARGET_DATA::ID => {
32134 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
32135 }
32136 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
32137 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
32138 }
32139 SET_HOME_POSITION_DATA::ID => {
32140 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
32141 }
32142 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
32143 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32144 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32145 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
32146 }
32147 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
32148 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32149 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
32150 }
32151 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
32152 SMART_BATTERY_INFO_DATA::ID => {
32153 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
32154 }
32155 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
32156 STORAGE_INFORMATION_DATA::ID => {
32157 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
32158 }
32159 SUPPORTED_TUNES_DATA::ID => {
32160 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
32161 }
32162 SYSTEM_TIME_DATA::ID => {
32163 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
32164 }
32165 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
32166 TERRAIN_CHECK_DATA::ID => {
32167 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
32168 }
32169 TERRAIN_DATA_DATA::ID => {
32170 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
32171 }
32172 TERRAIN_REPORT_DATA::ID => {
32173 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
32174 }
32175 TERRAIN_REQUEST_DATA::ID => {
32176 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
32177 }
32178 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
32179 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
32180 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
32181 .map(Self::TIME_ESTIMATE_TO_TARGET)
32182 }
32183 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
32184 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
32185 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
32186 }
32187 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
32188 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
32189 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
32190 }
32191 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
32192 UAVCAN_NODE_INFO_DATA::ID => {
32193 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
32194 }
32195 UAVCAN_NODE_STATUS_DATA::ID => {
32196 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
32197 }
32198 UTM_GLOBAL_POSITION_DATA::ID => {
32199 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
32200 }
32201 V2_EXTENSION_DATA::ID => {
32202 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
32203 }
32204 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
32205 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
32206 VICON_POSITION_ESTIMATE_DATA::ID => {
32207 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
32208 .map(Self::VICON_POSITION_ESTIMATE)
32209 }
32210 VIDEO_STREAM_INFORMATION_DATA::ID => {
32211 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
32212 .map(Self::VIDEO_STREAM_INFORMATION)
32213 }
32214 VIDEO_STREAM_STATUS_DATA::ID => {
32215 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
32216 }
32217 VISION_POSITION_ESTIMATE_DATA::ID => {
32218 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32219 .map(Self::VISION_POSITION_ESTIMATE)
32220 }
32221 VISION_SPEED_ESTIMATE_DATA::ID => {
32222 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
32223 }
32224 WHEEL_DISTANCE_DATA::ID => {
32225 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
32226 }
32227 WIFI_CONFIG_AP_DATA::ID => {
32228 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
32229 }
32230 WINCH_STATUS_DATA::ID => {
32231 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
32232 }
32233 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
32234 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
32235 }
32236 }
32237 fn message_name(&self) -> &'static str {
32238 match self {
32239 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
32240 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
32241 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
32242 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
32243 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
32244 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
32245 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
32246 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
32247 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
32248 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
32249 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
32250 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32251 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
32252 }
32253 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
32254 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
32255 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
32256 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
32257 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
32258 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
32259 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
32260 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
32261 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
32262 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
32263 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
32264 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
32265 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
32266 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
32267 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
32268 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
32269 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
32270 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
32271 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
32272 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
32273 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
32274 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
32275 Self::COLLISION(..) => COLLISION_DATA::NAME,
32276 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
32277 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
32278 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
32279 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
32280 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
32281 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
32282 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
32283 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
32284 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME,
32285 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME,
32286 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::NAME,
32287 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
32288 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
32289 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
32290 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
32291 Self::DEBUG(..) => DEBUG_DATA::NAME,
32292 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
32293 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
32294 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
32295 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
32296 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
32297 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
32298 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
32299 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
32300 Self::EVENT(..) => EVENT_DATA::NAME,
32301 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
32302 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
32303 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
32304 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
32305 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
32306 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
32307 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
32308 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
32309 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
32310 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
32311 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
32312 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
32313 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32314 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
32315 }
32316 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
32317 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
32318 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
32319 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
32320 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
32321 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
32322 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
32323 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
32324 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
32325 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
32326 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
32327 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
32328 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
32329 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
32330 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
32331 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::NAME,
32332 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
32333 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME
32334 }
32335 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
32336 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
32337 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
32338 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
32339 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
32340 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
32341 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
32342 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
32343 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
32344 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
32345 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
32346 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
32347 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
32348 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
32349 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
32350 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
32351 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
32352 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
32353 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
32354 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32355 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
32356 }
32357 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
32358 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
32359 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
32360 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
32361 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
32362 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
32363 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
32364 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
32365 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
32366 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
32367 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
32368 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
32369 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
32370 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
32371 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
32372 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
32373 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
32374 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
32375 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
32376 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
32377 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
32378 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
32379 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
32380 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
32381 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
32382 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
32383 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
32384 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
32385 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
32386 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
32387 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
32388 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
32389 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
32390 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
32391 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
32392 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
32393 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
32394 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
32395 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
32396 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
32397 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
32398 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
32399 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
32400 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
32401 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
32402 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
32403 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
32404 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
32405 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
32406 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
32407 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
32408 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
32409 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
32410 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
32411 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
32412 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
32413 Self::PING(..) => PING_DATA::NAME,
32414 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
32415 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
32416 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32417 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
32418 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
32419 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
32420 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
32421 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
32422 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
32423 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
32424 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
32425 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
32426 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
32427 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
32428 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
32429 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
32430 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
32431 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
32432 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
32433 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
32434 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
32435 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
32436 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
32437 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
32438 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
32439 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
32440 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
32441 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
32442 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
32443 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
32444 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
32445 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
32446 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
32447 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
32448 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32449 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
32450 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
32451 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
32452 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
32453 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
32454 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
32455 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
32456 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
32457 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
32458 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
32459 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
32460 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
32461 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
32462 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
32463 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
32464 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
32465 }
32466 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32467 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
32468 }
32469 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
32470 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
32471 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
32472 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
32473 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
32474 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
32475 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
32476 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
32477 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
32478 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
32479 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
32480 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
32481 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
32482 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
32483 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
32484 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
32485 }
32486 }
32487 fn message_id(&self) -> u32 {
32488 match self {
32489 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
32490 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
32491 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
32492 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
32493 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
32494 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
32495 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
32496 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
32497 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
32498 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
32499 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
32500 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32501 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
32502 }
32503 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
32504 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
32505 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
32506 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
32507 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
32508 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
32509 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
32510 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
32511 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
32512 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
32513 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
32514 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
32515 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
32516 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
32517 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
32518 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
32519 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
32520 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
32521 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
32522 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
32523 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
32524 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
32525 Self::COLLISION(..) => COLLISION_DATA::ID,
32526 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
32527 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
32528 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
32529 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
32530 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
32531 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
32532 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
32533 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
32534 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID,
32535 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID,
32536 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::ID,
32537 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
32538 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
32539 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
32540 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
32541 Self::DEBUG(..) => DEBUG_DATA::ID,
32542 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
32543 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
32544 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
32545 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
32546 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
32547 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
32548 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
32549 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
32550 Self::EVENT(..) => EVENT_DATA::ID,
32551 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
32552 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
32553 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
32554 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
32555 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
32556 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
32557 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
32558 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
32559 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
32560 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
32561 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
32562 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
32563 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32564 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
32565 }
32566 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
32567 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
32568 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
32569 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
32570 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
32571 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
32572 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
32573 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
32574 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
32575 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
32576 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
32577 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
32578 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
32579 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
32580 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
32581 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::ID,
32582 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
32583 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID
32584 }
32585 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
32586 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
32587 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
32588 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
32589 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
32590 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
32591 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
32592 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
32593 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
32594 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
32595 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
32596 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
32597 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
32598 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
32599 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
32600 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
32601 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
32602 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
32603 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
32604 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32605 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
32606 }
32607 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
32608 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
32609 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
32610 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
32611 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
32612 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
32613 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
32614 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
32615 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
32616 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
32617 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
32618 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
32619 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
32620 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
32621 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
32622 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
32623 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
32624 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
32625 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
32626 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
32627 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
32628 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
32629 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
32630 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
32631 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
32632 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
32633 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
32634 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
32635 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
32636 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
32637 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
32638 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
32639 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
32640 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
32641 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
32642 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
32643 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
32644 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
32645 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
32646 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
32647 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
32648 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
32649 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
32650 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
32651 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
32652 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
32653 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
32654 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
32655 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
32656 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
32657 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
32658 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
32659 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
32660 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
32661 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
32662 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
32663 Self::PING(..) => PING_DATA::ID,
32664 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
32665 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
32666 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
32667 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
32668 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
32669 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
32670 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
32671 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
32672 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
32673 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
32674 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
32675 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
32676 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
32677 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
32678 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
32679 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
32680 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
32681 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
32682 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
32683 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
32684 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
32685 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
32686 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
32687 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
32688 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
32689 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
32690 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
32691 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
32692 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
32693 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
32694 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
32695 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
32696 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
32697 Self::SET_MODE(..) => SET_MODE_DATA::ID,
32698 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
32699 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
32700 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
32701 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
32702 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
32703 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
32704 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
32705 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
32706 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
32707 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
32708 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
32709 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
32710 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
32711 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
32712 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
32713 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
32714 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32715 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
32716 }
32717 Self::TUNNEL(..) => TUNNEL_DATA::ID,
32718 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
32719 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
32720 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
32721 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
32722 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
32723 Self::VIBRATION(..) => VIBRATION_DATA::ID,
32724 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
32725 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
32726 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
32727 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
32728 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
32729 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
32730 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
32731 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
32732 Self::WIND_COV(..) => WIND_COV_DATA::ID,
32733 }
32734 }
32735 fn message_id_from_name(name: &str) -> Option<u32> {
32736 match name {
32737 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
32738 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
32739 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
32740 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
32741 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
32742 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
32743 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
32744 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
32745 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
32746 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
32747 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
32748 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
32749 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
32750 }
32751 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
32752 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
32753 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
32754 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
32755 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
32756 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
32757 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
32758 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
32759 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
32760 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
32761 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
32762 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
32763 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
32764 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
32765 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
32766 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
32767 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
32768 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
32769 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
32770 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
32771 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
32772 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
32773 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
32774 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
32775 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
32776 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
32777 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
32778 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
32779 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
32780 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
32781 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
32782 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME => {
32783 Some(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID)
32784 }
32785 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME => {
32786 Some(CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID)
32787 }
32788 CUBEPILOT_RAW_RC_DATA::NAME => Some(CUBEPILOT_RAW_RC_DATA::ID),
32789 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
32790 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
32791 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
32792 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
32793 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
32794 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
32795 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
32796 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
32797 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
32798 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
32799 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
32800 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
32801 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
32802 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
32803 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
32804 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
32805 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
32806 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
32807 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
32808 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
32809 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
32810 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
32811 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
32812 }
32813 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
32814 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
32815 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
32816 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
32817 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
32818 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
32819 }
32820 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
32821 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
32822 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
32823 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
32824 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
32825 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
32826 }
32827 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
32828 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
32829 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
32830 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
32831 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
32832 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
32833 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
32834 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
32835 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
32836 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
32837 HERELINK_TELEM_DATA::NAME => Some(HERELINK_TELEM_DATA::ID),
32838 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME => {
32839 Some(HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID)
32840 }
32841 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
32842 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
32843 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
32844 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
32845 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
32846 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
32847 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
32848 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
32849 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
32850 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
32851 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
32852 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
32853 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
32854 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
32855 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
32856 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
32857 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
32858 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
32859 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
32860 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
32861 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
32862 }
32863 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
32864 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
32865 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
32866 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
32867 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
32868 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
32869 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
32870 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
32871 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
32872 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
32873 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
32874 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
32875 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
32876 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
32877 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
32878 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
32879 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
32880 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
32881 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
32882 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
32883 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
32884 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
32885 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
32886 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
32887 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
32888 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
32889 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
32890 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
32891 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
32892 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
32893 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
32894 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
32895 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
32896 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
32897 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
32898 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
32899 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
32900 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
32901 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
32902 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
32903 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
32904 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
32905 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
32906 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
32907 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
32908 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
32909 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
32910 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
32911 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
32912 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
32913 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
32914 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
32915 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
32916 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
32917 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
32918 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
32919 PING_DATA::NAME => Some(PING_DATA::ID),
32920 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
32921 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
32922 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
32923 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
32924 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
32925 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
32926 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
32927 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
32928 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
32929 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
32930 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
32931 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
32932 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
32933 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
32934 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
32935 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
32936 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
32937 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
32938 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
32939 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
32940 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
32941 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
32942 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
32943 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
32944 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
32945 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
32946 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
32947 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
32948 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
32949 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
32950 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
32951 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
32952 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
32953 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
32954 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
32955 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
32956 }
32957 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
32958 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
32959 }
32960 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
32961 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
32962 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
32963 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
32964 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
32965 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
32966 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
32967 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
32968 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
32969 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
32970 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
32971 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
32972 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
32973 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
32974 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
32975 }
32976 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
32977 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
32978 }
32979 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
32980 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
32981 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
32982 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
32983 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
32984 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
32985 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
32986 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
32987 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
32988 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
32989 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
32990 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
32991 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
32992 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
32993 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
32994 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
32995 _ => None,
32996 }
32997 }
32998 fn default_message_from_id(id: u32) -> Option<Self> {
32999 match id {
33000 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33001 ACTUATOR_CONTROL_TARGET_DATA::default(),
33002 )),
33003 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33004 ACTUATOR_OUTPUT_STATUS_DATA::default(),
33005 )),
33006 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
33007 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
33008 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
33009 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
33010 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33011 ATTITUDE_QUATERNION_DATA::default(),
33012 )),
33013 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33014 ATTITUDE_QUATERNION_COV_DATA::default(),
33015 )),
33016 ATTITUDE_TARGET_DATA::ID => {
33017 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
33018 }
33019 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
33020 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
33021 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33022 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33023 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
33024 ))
33025 }
33026 AUTOPILOT_VERSION_DATA::ID => {
33027 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
33028 }
33029 AVAILABLE_MODES_DATA::ID => {
33030 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
33031 }
33032 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33033 AVAILABLE_MODES_MONITOR_DATA::default(),
33034 )),
33035 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
33036 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
33037 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
33038 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33039 CAMERA_CAPTURE_STATUS_DATA::default(),
33040 )),
33041 CAMERA_FOV_STATUS_DATA::ID => {
33042 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
33043 }
33044 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33045 CAMERA_IMAGE_CAPTURED_DATA::default(),
33046 )),
33047 CAMERA_INFORMATION_DATA::ID => {
33048 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
33049 }
33050 CAMERA_SETTINGS_DATA::ID => {
33051 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
33052 }
33053 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33054 CAMERA_THERMAL_RANGE_DATA::default(),
33055 )),
33056 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33057 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
33058 )),
33059 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33060 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
33061 )),
33062 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
33063 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
33064 CAN_FILTER_MODIFY_DATA::ID => {
33065 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
33066 }
33067 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
33068 CELLULAR_CONFIG_DATA::ID => {
33069 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
33070 }
33071 CELLULAR_STATUS_DATA::ID => {
33072 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
33073 }
33074 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33075 CHANGE_OPERATOR_CONTROL_DATA::default(),
33076 )),
33077 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33078 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
33079 )),
33080 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
33081 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
33082 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
33083 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
33084 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
33085 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33086 COMPONENT_INFORMATION_DATA::default(),
33087 )),
33088 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33089 COMPONENT_INFORMATION_BASIC_DATA::default(),
33090 )),
33091 COMPONENT_METADATA_DATA::ID => {
33092 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
33093 }
33094 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33095 CONTROL_SYSTEM_STATE_DATA::default(),
33096 )),
33097 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
33098 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::default(),
33099 )),
33100 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
33101 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
33102 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::default(),
33103 ))
33104 }
33105 CUBEPILOT_RAW_RC_DATA::ID => {
33106 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::default()))
33107 }
33108 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33109 CURRENT_EVENT_SEQUENCE_DATA::default(),
33110 )),
33111 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
33112 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
33113 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33114 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
33115 )),
33116 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
33117 DEBUG_FLOAT_ARRAY_DATA::ID => {
33118 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
33119 }
33120 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
33121 DISTANCE_SENSOR_DATA::ID => {
33122 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
33123 }
33124 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
33125 ENCAPSULATED_DATA_DATA::ID => {
33126 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
33127 }
33128 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
33129 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
33130 ESTIMATOR_STATUS_DATA::ID => {
33131 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
33132 }
33133 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
33134 EXTENDED_SYS_STATE_DATA::ID => {
33135 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
33136 }
33137 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
33138 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33139 FILE_TRANSFER_PROTOCOL_DATA::default(),
33140 )),
33141 FLIGHT_INFORMATION_DATA::ID => {
33142 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
33143 }
33144 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
33145 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
33146 GENERATOR_STATUS_DATA::ID => {
33147 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
33148 }
33149 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33150 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
33151 )),
33152 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33153 GIMBAL_DEVICE_INFORMATION_DATA::default(),
33154 )),
33155 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33156 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
33157 )),
33158 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33159 GIMBAL_MANAGER_INFORMATION_DATA::default(),
33160 )),
33161 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33162 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
33163 )),
33164 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33165 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33166 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
33167 ))
33168 }
33169 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33170 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
33171 )),
33172 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33173 GIMBAL_MANAGER_STATUS_DATA::default(),
33174 )),
33175 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33176 GLOBAL_POSITION_INT_DATA::default(),
33177 )),
33178 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33179 GLOBAL_POSITION_INT_COV_DATA::default(),
33180 )),
33181 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33182 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33183 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
33184 ))
33185 }
33186 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
33187 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
33188 GPS_GLOBAL_ORIGIN_DATA::ID => {
33189 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
33190 }
33191 GPS_INJECT_DATA_DATA::ID => {
33192 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
33193 }
33194 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
33195 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
33196 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
33197 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
33198 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
33199 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
33200 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::default())),
33201 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
33202 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
33203 HERELINK_VIDEO_STREAM_INFORMATION_DATA::default(),
33204 ))
33205 }
33206 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
33207 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
33208 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
33209 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33210 HIL_ACTUATOR_CONTROLS_DATA::default(),
33211 )),
33212 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
33213 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
33214 HIL_OPTICAL_FLOW_DATA::ID => {
33215 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
33216 }
33217 HIL_RC_INPUTS_RAW_DATA::ID => {
33218 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
33219 }
33220 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
33221 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
33222 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33223 HIL_STATE_QUATERNION_DATA::default(),
33224 )),
33225 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
33226 HYGROMETER_SENSOR_DATA::ID => {
33227 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
33228 }
33229 ILLUMINATOR_STATUS_DATA::ID => {
33230 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
33231 }
33232 ISBD_LINK_STATUS_DATA::ID => {
33233 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
33234 }
33235 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
33236 LINK_NODE_STATUS_DATA::ID => {
33237 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
33238 }
33239 LOCAL_POSITION_NED_DATA::ID => {
33240 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
33241 }
33242 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33243 LOCAL_POSITION_NED_COV_DATA::default(),
33244 )),
33245 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33246 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33247 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
33248 ))
33249 }
33250 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
33251 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
33252 LOGGING_DATA_ACKED_DATA::ID => {
33253 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
33254 }
33255 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
33256 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
33257 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
33258 LOG_REQUEST_DATA_DATA::ID => {
33259 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
33260 }
33261 LOG_REQUEST_END_DATA::ID => {
33262 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
33263 }
33264 LOG_REQUEST_LIST_DATA::ID => {
33265 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
33266 }
33267 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
33268 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
33269 MANUAL_SETPOINT_DATA::ID => {
33270 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
33271 }
33272 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
33273 MESSAGE_INTERVAL_DATA::ID => {
33274 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
33275 }
33276 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
33277 MISSION_CLEAR_ALL_DATA::ID => {
33278 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
33279 }
33280 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
33281 MISSION_CURRENT_DATA::ID => {
33282 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
33283 }
33284 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
33285 MISSION_ITEM_INT_DATA::ID => {
33286 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
33287 }
33288 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33289 MISSION_ITEM_REACHED_DATA::default(),
33290 )),
33291 MISSION_REQUEST_DATA::ID => {
33292 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
33293 }
33294 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33295 MISSION_REQUEST_INT_DATA::default(),
33296 )),
33297 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33298 MISSION_REQUEST_LIST_DATA::default(),
33299 )),
33300 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33301 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
33302 )),
33303 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33304 MISSION_SET_CURRENT_DATA::default(),
33305 )),
33306 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33307 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
33308 )),
33309 MOUNT_ORIENTATION_DATA::ID => {
33310 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
33311 }
33312 NAMED_VALUE_FLOAT_DATA::ID => {
33313 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
33314 }
33315 NAMED_VALUE_INT_DATA::ID => {
33316 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
33317 }
33318 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33319 NAV_CONTROLLER_OUTPUT_DATA::default(),
33320 )),
33321 OBSTACLE_DISTANCE_DATA::ID => {
33322 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
33323 }
33324 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
33325 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33326 ONBOARD_COMPUTER_STATUS_DATA::default(),
33327 )),
33328 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33329 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
33330 )),
33331 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33332 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
33333 )),
33334 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33335 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
33336 )),
33337 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33338 OPEN_DRONE_ID_LOCATION_DATA::default(),
33339 )),
33340 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33341 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
33342 )),
33343 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33344 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
33345 )),
33346 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33347 OPEN_DRONE_ID_SELF_ID_DATA::default(),
33348 )),
33349 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33350 OPEN_DRONE_ID_SYSTEM_DATA::default(),
33351 )),
33352 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33353 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
33354 )),
33355 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
33356 OPTICAL_FLOW_RAD_DATA::ID => {
33357 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
33358 }
33359 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33360 ORBIT_EXECUTION_STATUS_DATA::default(),
33361 )),
33362 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
33363 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33364 PARAM_EXT_REQUEST_LIST_DATA::default(),
33365 )),
33366 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33367 PARAM_EXT_REQUEST_READ_DATA::default(),
33368 )),
33369 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
33370 PARAM_EXT_VALUE_DATA::ID => {
33371 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
33372 }
33373 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
33374 PARAM_REQUEST_LIST_DATA::ID => {
33375 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
33376 }
33377 PARAM_REQUEST_READ_DATA::ID => {
33378 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
33379 }
33380 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
33381 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
33382 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
33383 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
33384 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
33385 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33386 POSITION_TARGET_GLOBAL_INT_DATA::default(),
33387 )),
33388 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33389 POSITION_TARGET_LOCAL_NED_DATA::default(),
33390 )),
33391 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
33392 PROTOCOL_VERSION_DATA::ID => {
33393 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
33394 }
33395 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
33396 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
33397 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
33398 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
33399 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
33400 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33401 RC_CHANNELS_OVERRIDE_DATA::default(),
33402 )),
33403 RC_CHANNELS_RAW_DATA::ID => {
33404 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
33405 }
33406 RC_CHANNELS_SCALED_DATA::ID => {
33407 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
33408 }
33409 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33410 REQUEST_DATA_STREAM_DATA::default(),
33411 )),
33412 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
33413 RESOURCE_REQUEST_DATA::ID => {
33414 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
33415 }
33416 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33417 RESPONSE_EVENT_ERROR_DATA::default(),
33418 )),
33419 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33420 SAFETY_ALLOWED_AREA_DATA::default(),
33421 )),
33422 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33423 SAFETY_SET_ALLOWED_AREA_DATA::default(),
33424 )),
33425 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
33426 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
33427 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
33428 SCALED_PRESSURE_DATA::ID => {
33429 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
33430 }
33431 SCALED_PRESSURE2_DATA::ID => {
33432 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
33433 }
33434 SCALED_PRESSURE3_DATA::ID => {
33435 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
33436 }
33437 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
33438 SERVO_OUTPUT_RAW_DATA::ID => {
33439 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
33440 }
33441 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
33442 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
33443 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
33444 )),
33445 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
33446 SET_ATTITUDE_TARGET_DATA::default(),
33447 )),
33448 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
33449 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
33450 )),
33451 SET_HOME_POSITION_DATA::ID => {
33452 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
33453 }
33454 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
33455 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
33456 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
33457 )),
33458 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
33459 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
33460 )),
33461 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
33462 SMART_BATTERY_INFO_DATA::ID => {
33463 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
33464 }
33465 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
33466 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
33467 STORAGE_INFORMATION_DATA::default(),
33468 )),
33469 SUPPORTED_TUNES_DATA::ID => {
33470 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
33471 }
33472 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
33473 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
33474 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
33475 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
33476 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
33477 TERRAIN_REQUEST_DATA::ID => {
33478 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
33479 }
33480 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
33481 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
33482 TIME_ESTIMATE_TO_TARGET_DATA::default(),
33483 )),
33484 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33485 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
33486 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
33487 ))
33488 }
33489 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33490 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
33491 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
33492 ))
33493 }
33494 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
33495 UAVCAN_NODE_INFO_DATA::ID => {
33496 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
33497 }
33498 UAVCAN_NODE_STATUS_DATA::ID => {
33499 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
33500 }
33501 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
33502 UTM_GLOBAL_POSITION_DATA::default(),
33503 )),
33504 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
33505 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
33506 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
33507 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
33508 VICON_POSITION_ESTIMATE_DATA::default(),
33509 )),
33510 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
33511 VIDEO_STREAM_INFORMATION_DATA::default(),
33512 )),
33513 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
33514 VIDEO_STREAM_STATUS_DATA::default(),
33515 )),
33516 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
33517 VISION_POSITION_ESTIMATE_DATA::default(),
33518 )),
33519 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
33520 VISION_SPEED_ESTIMATE_DATA::default(),
33521 )),
33522 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
33523 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
33524 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
33525 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
33526 _ => None,
33527 }
33528 }
33529 #[cfg(feature = "arbitrary")]
33530 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
33531 match id {
33532 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33533 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
33534 )),
33535 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33536 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
33537 )),
33538 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
33539 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
33540 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
33541 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
33542 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33543 ATTITUDE_QUATERNION_DATA::random(rng),
33544 )),
33545 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33546 ATTITUDE_QUATERNION_COV_DATA::random(rng),
33547 )),
33548 ATTITUDE_TARGET_DATA::ID => {
33549 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
33550 }
33551 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
33552 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
33553 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33554 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33555 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
33556 ))
33557 }
33558 AUTOPILOT_VERSION_DATA::ID => {
33559 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
33560 }
33561 AVAILABLE_MODES_DATA::ID => {
33562 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
33563 }
33564 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33565 AVAILABLE_MODES_MONITOR_DATA::random(rng),
33566 )),
33567 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
33568 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
33569 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
33570 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33571 CAMERA_CAPTURE_STATUS_DATA::random(rng),
33572 )),
33573 CAMERA_FOV_STATUS_DATA::ID => {
33574 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
33575 }
33576 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33577 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
33578 )),
33579 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
33580 CAMERA_INFORMATION_DATA::random(rng),
33581 )),
33582 CAMERA_SETTINGS_DATA::ID => {
33583 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
33584 }
33585 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33586 CAMERA_THERMAL_RANGE_DATA::random(rng),
33587 )),
33588 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33589 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
33590 )),
33591 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33592 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
33593 )),
33594 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
33595 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
33596 CAN_FILTER_MODIFY_DATA::ID => {
33597 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
33598 }
33599 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
33600 CELLULAR_CONFIG_DATA::ID => {
33601 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
33602 }
33603 CELLULAR_STATUS_DATA::ID => {
33604 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
33605 }
33606 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33607 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
33608 )),
33609 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33610 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
33611 )),
33612 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
33613 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
33614 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
33615 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
33616 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
33617 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33618 COMPONENT_INFORMATION_DATA::random(rng),
33619 )),
33620 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33621 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
33622 )),
33623 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
33624 COMPONENT_METADATA_DATA::random(rng),
33625 )),
33626 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33627 CONTROL_SYSTEM_STATE_DATA::random(rng),
33628 )),
33629 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
33630 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::random(rng),
33631 )),
33632 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
33633 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
33634 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::random(rng),
33635 ))
33636 }
33637 CUBEPILOT_RAW_RC_DATA::ID => {
33638 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::random(rng)))
33639 }
33640 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33641 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
33642 )),
33643 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
33644 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
33645 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33646 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
33647 )),
33648 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
33649 DEBUG_FLOAT_ARRAY_DATA::ID => {
33650 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
33651 }
33652 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
33653 DISTANCE_SENSOR_DATA::ID => {
33654 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
33655 }
33656 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
33657 ENCAPSULATED_DATA_DATA::ID => {
33658 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
33659 }
33660 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
33661 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
33662 ESTIMATOR_STATUS_DATA::ID => {
33663 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
33664 }
33665 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
33666 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
33667 EXTENDED_SYS_STATE_DATA::random(rng),
33668 )),
33669 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
33670 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33671 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
33672 )),
33673 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
33674 FLIGHT_INFORMATION_DATA::random(rng),
33675 )),
33676 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
33677 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
33678 GENERATOR_STATUS_DATA::ID => {
33679 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
33680 }
33681 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33682 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
33683 )),
33684 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33685 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
33686 )),
33687 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33688 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
33689 )),
33690 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33691 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
33692 )),
33693 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33694 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
33695 )),
33696 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33697 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33698 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
33699 ))
33700 }
33701 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33702 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
33703 )),
33704 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33705 GIMBAL_MANAGER_STATUS_DATA::random(rng),
33706 )),
33707 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33708 GLOBAL_POSITION_INT_DATA::random(rng),
33709 )),
33710 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33711 GLOBAL_POSITION_INT_COV_DATA::random(rng),
33712 )),
33713 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33714 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33715 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
33716 ))
33717 }
33718 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
33719 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
33720 GPS_GLOBAL_ORIGIN_DATA::ID => {
33721 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
33722 }
33723 GPS_INJECT_DATA_DATA::ID => {
33724 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
33725 }
33726 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
33727 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
33728 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
33729 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
33730 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
33731 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
33732 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::random(rng))),
33733 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
33734 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
33735 HERELINK_VIDEO_STREAM_INFORMATION_DATA::random(rng),
33736 ))
33737 }
33738 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
33739 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
33740 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
33741 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33742 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
33743 )),
33744 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
33745 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
33746 HIL_OPTICAL_FLOW_DATA::ID => {
33747 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
33748 }
33749 HIL_RC_INPUTS_RAW_DATA::ID => {
33750 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
33751 }
33752 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
33753 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
33754 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33755 HIL_STATE_QUATERNION_DATA::random(rng),
33756 )),
33757 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
33758 HYGROMETER_SENSOR_DATA::ID => {
33759 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
33760 }
33761 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
33762 ILLUMINATOR_STATUS_DATA::random(rng),
33763 )),
33764 ISBD_LINK_STATUS_DATA::ID => {
33765 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
33766 }
33767 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
33768 LINK_NODE_STATUS_DATA::ID => {
33769 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
33770 }
33771 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
33772 LOCAL_POSITION_NED_DATA::random(rng),
33773 )),
33774 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33775 LOCAL_POSITION_NED_COV_DATA::random(rng),
33776 )),
33777 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33778 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33779 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
33780 ))
33781 }
33782 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
33783 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
33784 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
33785 LOGGING_DATA_ACKED_DATA::random(rng),
33786 )),
33787 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
33788 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
33789 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
33790 LOG_REQUEST_DATA_DATA::ID => {
33791 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
33792 }
33793 LOG_REQUEST_END_DATA::ID => {
33794 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
33795 }
33796 LOG_REQUEST_LIST_DATA::ID => {
33797 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
33798 }
33799 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
33800 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
33801 MANUAL_SETPOINT_DATA::ID => {
33802 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
33803 }
33804 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
33805 MESSAGE_INTERVAL_DATA::ID => {
33806 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
33807 }
33808 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
33809 MISSION_CLEAR_ALL_DATA::ID => {
33810 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
33811 }
33812 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
33813 MISSION_CURRENT_DATA::ID => {
33814 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
33815 }
33816 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
33817 MISSION_ITEM_INT_DATA::ID => {
33818 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
33819 }
33820 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33821 MISSION_ITEM_REACHED_DATA::random(rng),
33822 )),
33823 MISSION_REQUEST_DATA::ID => {
33824 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
33825 }
33826 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33827 MISSION_REQUEST_INT_DATA::random(rng),
33828 )),
33829 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33830 MISSION_REQUEST_LIST_DATA::random(rng),
33831 )),
33832 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33833 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
33834 )),
33835 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33836 MISSION_SET_CURRENT_DATA::random(rng),
33837 )),
33838 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33839 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
33840 )),
33841 MOUNT_ORIENTATION_DATA::ID => {
33842 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
33843 }
33844 NAMED_VALUE_FLOAT_DATA::ID => {
33845 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
33846 }
33847 NAMED_VALUE_INT_DATA::ID => {
33848 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
33849 }
33850 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33851 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
33852 )),
33853 OBSTACLE_DISTANCE_DATA::ID => {
33854 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
33855 }
33856 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
33857 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33858 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
33859 )),
33860 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33861 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
33862 )),
33863 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33864 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
33865 )),
33866 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33867 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
33868 )),
33869 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33870 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
33871 )),
33872 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33873 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
33874 )),
33875 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33876 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
33877 )),
33878 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33879 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
33880 )),
33881 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33882 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
33883 )),
33884 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33885 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
33886 )),
33887 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
33888 OPTICAL_FLOW_RAD_DATA::ID => {
33889 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
33890 }
33891 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33892 ORBIT_EXECUTION_STATUS_DATA::random(rng),
33893 )),
33894 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
33895 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33896 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
33897 )),
33898 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33899 PARAM_EXT_REQUEST_READ_DATA::random(rng),
33900 )),
33901 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
33902 PARAM_EXT_VALUE_DATA::ID => {
33903 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
33904 }
33905 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
33906 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
33907 PARAM_REQUEST_LIST_DATA::random(rng),
33908 )),
33909 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
33910 PARAM_REQUEST_READ_DATA::random(rng),
33911 )),
33912 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
33913 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
33914 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
33915 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
33916 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
33917 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33918 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
33919 )),
33920 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33921 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
33922 )),
33923 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
33924 PROTOCOL_VERSION_DATA::ID => {
33925 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
33926 }
33927 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
33928 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
33929 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
33930 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
33931 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
33932 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33933 RC_CHANNELS_OVERRIDE_DATA::random(rng),
33934 )),
33935 RC_CHANNELS_RAW_DATA::ID => {
33936 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
33937 }
33938 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
33939 RC_CHANNELS_SCALED_DATA::random(rng),
33940 )),
33941 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33942 REQUEST_DATA_STREAM_DATA::random(rng),
33943 )),
33944 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
33945 RESOURCE_REQUEST_DATA::ID => {
33946 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
33947 }
33948 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33949 RESPONSE_EVENT_ERROR_DATA::random(rng),
33950 )),
33951 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33952 SAFETY_ALLOWED_AREA_DATA::random(rng),
33953 )),
33954 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33955 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
33956 )),
33957 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
33958 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
33959 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
33960 SCALED_PRESSURE_DATA::ID => {
33961 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
33962 }
33963 SCALED_PRESSURE2_DATA::ID => {
33964 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
33965 }
33966 SCALED_PRESSURE3_DATA::ID => {
33967 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
33968 }
33969 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
33970 SERVO_OUTPUT_RAW_DATA::ID => {
33971 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
33972 }
33973 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
33974 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
33975 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
33976 )),
33977 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
33978 SET_ATTITUDE_TARGET_DATA::random(rng),
33979 )),
33980 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
33981 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
33982 )),
33983 SET_HOME_POSITION_DATA::ID => {
33984 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
33985 }
33986 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
33987 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
33988 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
33989 )),
33990 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
33991 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
33992 )),
33993 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
33994 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
33995 SMART_BATTERY_INFO_DATA::random(rng),
33996 )),
33997 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
33998 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
33999 STORAGE_INFORMATION_DATA::random(rng),
34000 )),
34001 SUPPORTED_TUNES_DATA::ID => {
34002 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
34003 }
34004 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
34005 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
34006 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
34007 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
34008 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
34009 TERRAIN_REQUEST_DATA::ID => {
34010 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
34011 }
34012 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
34013 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34014 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
34015 )),
34016 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34017 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34018 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
34019 ))
34020 }
34021 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34022 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34023 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
34024 ))
34025 }
34026 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
34027 UAVCAN_NODE_INFO_DATA::ID => {
34028 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
34029 }
34030 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
34031 UAVCAN_NODE_STATUS_DATA::random(rng),
34032 )),
34033 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34034 UTM_GLOBAL_POSITION_DATA::random(rng),
34035 )),
34036 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
34037 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
34038 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
34039 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34040 VICON_POSITION_ESTIMATE_DATA::random(rng),
34041 )),
34042 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34043 VIDEO_STREAM_INFORMATION_DATA::random(rng),
34044 )),
34045 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34046 VIDEO_STREAM_STATUS_DATA::random(rng),
34047 )),
34048 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34049 VISION_POSITION_ESTIMATE_DATA::random(rng),
34050 )),
34051 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34052 VISION_SPEED_ESTIMATE_DATA::random(rng),
34053 )),
34054 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
34055 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
34056 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
34057 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
34058 _ => None,
34059 }
34060 }
34061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34062 match self {
34063 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34064 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
34065 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
34066 Self::AIS_VESSEL(body) => body.ser(version, bytes),
34067 Self::ALTITUDE(body) => body.ser(version, bytes),
34068 Self::ATTITUDE(body) => body.ser(version, bytes),
34069 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
34070 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
34071 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
34072 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
34073 Self::AUTH_KEY(body) => body.ser(version, bytes),
34074 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
34075 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
34076 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
34077 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
34078 Self::BATTERY_INFO(body) => body.ser(version, bytes),
34079 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
34080 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
34081 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
34082 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
34083 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
34084 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
34085 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
34086 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
34087 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
34088 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
34089 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
34090 Self::CANFD_FRAME(body) => body.ser(version, bytes),
34091 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
34092 Self::CAN_FRAME(body) => body.ser(version, bytes),
34093 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
34094 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
34095 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
34096 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
34097 Self::COLLISION(body) => body.ser(version, bytes),
34098 Self::COMMAND_ACK(body) => body.ser(version, bytes),
34099 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
34100 Self::COMMAND_INT(body) => body.ser(version, bytes),
34101 Self::COMMAND_LONG(body) => body.ser(version, bytes),
34102 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
34103 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
34104 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
34105 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
34106 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(body) => body.ser(version, bytes),
34107 Self::CUBEPILOT_FIRMWARE_UPDATE_START(body) => body.ser(version, bytes),
34108 Self::CUBEPILOT_RAW_RC(body) => body.ser(version, bytes),
34109 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
34110 Self::CURRENT_MODE(body) => body.ser(version, bytes),
34111 Self::DATA_STREAM(body) => body.ser(version, bytes),
34112 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
34113 Self::DEBUG(body) => body.ser(version, bytes),
34114 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
34115 Self::DEBUG_VECT(body) => body.ser(version, bytes),
34116 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
34117 Self::EFI_STATUS(body) => body.ser(version, bytes),
34118 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
34119 Self::ESC_INFO(body) => body.ser(version, bytes),
34120 Self::ESC_STATUS(body) => body.ser(version, bytes),
34121 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
34122 Self::EVENT(body) => body.ser(version, bytes),
34123 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
34124 Self::FENCE_STATUS(body) => body.ser(version, bytes),
34125 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
34126 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
34127 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
34128 Self::FUEL_STATUS(body) => body.ser(version, bytes),
34129 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
34130 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
34131 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
34132 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
34133 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
34134 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
34135 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
34136 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
34137 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
34138 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
34139 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
34140 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34141 Self::GPS2_RAW(body) => body.ser(version, bytes),
34142 Self::GPS2_RTK(body) => body.ser(version, bytes),
34143 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34144 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
34145 Self::GPS_INPUT(body) => body.ser(version, bytes),
34146 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
34147 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
34148 Self::GPS_RTK(body) => body.ser(version, bytes),
34149 Self::GPS_STATUS(body) => body.ser(version, bytes),
34150 Self::HEARTBEAT(body) => body.ser(version, bytes),
34151 Self::HERELINK_TELEM(body) => body.ser(version, bytes),
34152 Self::HERELINK_VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
34153 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
34154 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
34155 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
34156 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
34157 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
34158 Self::HIL_GPS(body) => body.ser(version, bytes),
34159 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
34160 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
34161 Self::HIL_SENSOR(body) => body.ser(version, bytes),
34162 Self::HIL_STATE(body) => body.ser(version, bytes),
34163 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
34164 Self::HOME_POSITION(body) => body.ser(version, bytes),
34165 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
34166 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
34167 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
34168 Self::LANDING_TARGET(body) => body.ser(version, bytes),
34169 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
34170 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
34171 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
34172 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
34173 Self::LOGGING_ACK(body) => body.ser(version, bytes),
34174 Self::LOGGING_DATA(body) => body.ser(version, bytes),
34175 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
34176 Self::LOG_DATA(body) => body.ser(version, bytes),
34177 Self::LOG_ENTRY(body) => body.ser(version, bytes),
34178 Self::LOG_ERASE(body) => body.ser(version, bytes),
34179 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
34180 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
34181 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
34182 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
34183 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
34184 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
34185 Self::MEMORY_VECT(body) => body.ser(version, bytes),
34186 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
34187 Self::MISSION_ACK(body) => body.ser(version, bytes),
34188 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
34189 Self::MISSION_COUNT(body) => body.ser(version, bytes),
34190 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
34191 Self::MISSION_ITEM(body) => body.ser(version, bytes),
34192 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
34193 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
34194 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
34195 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
34196 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
34197 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
34198 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
34199 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
34200 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
34201 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
34202 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
34203 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
34204 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
34205 Self::ODOMETRY(body) => body.ser(version, bytes),
34206 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
34207 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
34208 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
34209 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
34210 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
34211 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
34212 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
34213 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
34214 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
34215 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
34216 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
34217 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
34218 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
34219 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
34220 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
34221 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
34222 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
34223 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
34224 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
34225 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
34226 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
34227 Self::PARAM_SET(body) => body.ser(version, bytes),
34228 Self::PARAM_VALUE(body) => body.ser(version, bytes),
34229 Self::PING(body) => body.ser(version, bytes),
34230 Self::PLAY_TUNE(body) => body.ser(version, bytes),
34231 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
34232 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34233 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34234 Self::POWER_STATUS(body) => body.ser(version, bytes),
34235 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
34236 Self::RADIO_STATUS(body) => body.ser(version, bytes),
34237 Self::RAW_IMU(body) => body.ser(version, bytes),
34238 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
34239 Self::RAW_RPM(body) => body.ser(version, bytes),
34240 Self::RC_CHANNELS(body) => body.ser(version, bytes),
34241 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
34242 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
34243 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
34244 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
34245 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
34246 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
34247 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
34248 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
34249 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
34250 Self::SCALED_IMU(body) => body.ser(version, bytes),
34251 Self::SCALED_IMU2(body) => body.ser(version, bytes),
34252 Self::SCALED_IMU3(body) => body.ser(version, bytes),
34253 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
34254 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
34255 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
34256 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
34257 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
34258 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
34259 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34260 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
34261 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34262 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
34263 Self::SET_MODE(body) => body.ser(version, bytes),
34264 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34265 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34266 Self::SIM_STATE(body) => body.ser(version, bytes),
34267 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
34268 Self::STATUSTEXT(body) => body.ser(version, bytes),
34269 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
34270 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
34271 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
34272 Self::SYS_STATUS(body) => body.ser(version, bytes),
34273 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
34274 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
34275 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
34276 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
34277 Self::TIMESYNC(body) => body.ser(version, bytes),
34278 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
34279 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
34280 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
34281 Self::TUNNEL(body) => body.ser(version, bytes),
34282 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
34283 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
34284 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
34285 Self::V2_EXTENSION(body) => body.ser(version, bytes),
34286 Self::VFR_HUD(body) => body.ser(version, bytes),
34287 Self::VIBRATION(body) => body.ser(version, bytes),
34288 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34289 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
34290 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
34291 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34292 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
34293 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
34294 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
34295 Self::WINCH_STATUS(body) => body.ser(version, bytes),
34296 Self::WIND_COV(body) => body.ser(version, bytes),
34297 }
34298 }
34299 fn extra_crc(id: u32) -> u8 {
34300 match id {
34301 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34302 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
34303 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
34304 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
34305 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
34306 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
34307 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
34308 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
34309 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
34310 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
34311 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
34312 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34313 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
34314 }
34315 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
34316 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
34317 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
34318 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
34319 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
34320 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
34321 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
34322 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
34323 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
34324 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
34325 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
34326 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
34327 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
34328 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
34329 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
34330 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
34331 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
34332 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
34333 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
34334 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
34335 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
34336 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
34337 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
34338 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
34339 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
34340 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
34341 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
34342 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
34343 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
34344 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
34345 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
34346 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
34347 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::EXTRA_CRC
34348 }
34349 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
34350 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::EXTRA_CRC
34351 }
34352 CUBEPILOT_RAW_RC_DATA::ID => CUBEPILOT_RAW_RC_DATA::EXTRA_CRC,
34353 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
34354 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
34355 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
34356 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
34357 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
34358 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
34359 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
34360 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
34361 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
34362 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
34363 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
34364 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
34365 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
34366 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
34367 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
34368 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
34369 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
34370 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
34371 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
34372 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
34373 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
34374 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
34375 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
34376 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
34377 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
34378 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
34379 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34380 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
34381 }
34382 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
34383 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
34384 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
34385 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
34386 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34387 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
34388 }
34389 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
34390 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
34391 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34392 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
34393 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
34394 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
34395 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
34396 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
34397 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
34398 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
34399 HERELINK_TELEM_DATA::ID => HERELINK_TELEM_DATA::EXTRA_CRC,
34400 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
34401 HERELINK_VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC
34402 }
34403 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
34404 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
34405 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
34406 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
34407 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
34408 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
34409 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
34410 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
34411 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
34412 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
34413 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
34414 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
34415 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
34416 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
34417 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
34418 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
34419 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
34420 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
34421 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
34422 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34423 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
34424 }
34425 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
34426 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
34427 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
34428 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
34429 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
34430 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
34431 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
34432 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
34433 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
34434 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
34435 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
34436 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
34437 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
34438 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
34439 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
34440 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
34441 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
34442 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
34443 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
34444 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
34445 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
34446 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
34447 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
34448 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
34449 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
34450 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
34451 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
34452 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
34453 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
34454 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
34455 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
34456 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
34457 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
34458 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
34459 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
34460 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
34461 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
34462 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
34463 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
34464 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
34465 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
34466 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
34467 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
34468 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
34469 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
34470 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
34471 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
34472 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
34473 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
34474 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
34475 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
34476 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
34477 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
34478 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
34479 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
34480 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
34481 PING_DATA::ID => PING_DATA::EXTRA_CRC,
34482 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
34483 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
34484 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
34485 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34486 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
34487 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
34488 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
34489 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
34490 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
34491 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
34492 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
34493 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
34494 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
34495 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
34496 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
34497 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
34498 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
34499 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
34500 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
34501 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
34502 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
34503 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
34504 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
34505 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
34506 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
34507 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
34508 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
34509 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
34510 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
34511 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34512 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
34513 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34514 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
34515 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
34516 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34517 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
34518 }
34519 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34520 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
34521 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
34522 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
34523 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
34524 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
34525 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
34526 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
34527 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
34528 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
34529 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
34530 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
34531 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
34532 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
34533 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34534 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
34535 }
34536 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34537 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
34538 }
34539 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
34540 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
34541 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
34542 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
34543 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
34544 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
34545 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
34546 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34547 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
34548 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
34549 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34550 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
34551 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
34552 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
34553 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
34554 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
34555 _ => 0,
34556 }
34557 }
34558 fn target_system_id(&self) -> Option<u8> {
34559 match self {
34560 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
34561 Self::CANFD_FRAME(inner) => Some(inner.target_system),
34562 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
34563 Self::CAN_FRAME(inner) => Some(inner.target_system),
34564 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
34565 Self::COMMAND_ACK(inner) => Some(inner.target_system),
34566 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
34567 Self::COMMAND_INT(inner) => Some(inner.target_system),
34568 Self::COMMAND_LONG(inner) => Some(inner.target_system),
34569 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_system),
34570 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_system),
34571 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
34572 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
34573 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
34574 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
34575 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
34576 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
34577 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
34578 Self::LOGGING_ACK(inner) => Some(inner.target_system),
34579 Self::LOGGING_DATA(inner) => Some(inner.target_system),
34580 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
34581 Self::LOG_ERASE(inner) => Some(inner.target_system),
34582 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
34583 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
34584 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
34585 Self::MISSION_ACK(inner) => Some(inner.target_system),
34586 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
34587 Self::MISSION_COUNT(inner) => Some(inner.target_system),
34588 Self::MISSION_ITEM(inner) => Some(inner.target_system),
34589 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
34590 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
34591 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
34592 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
34593 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
34594 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
34595 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
34596 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
34597 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
34598 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
34599 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
34600 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
34601 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
34602 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
34603 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
34604 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
34605 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
34606 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
34607 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
34608 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
34609 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
34610 Self::PARAM_SET(inner) => Some(inner.target_system),
34611 Self::PING(inner) => Some(inner.target_system),
34612 Self::PLAY_TUNE(inner) => Some(inner.target_system),
34613 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
34614 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
34615 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
34616 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
34617 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
34618 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
34619 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
34620 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
34621 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
34622 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
34623 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
34624 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
34625 Self::SET_MODE(inner) => Some(inner.target_system),
34626 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
34627 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
34628 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
34629 Self::TIMESYNC(inner) => Some(inner.target_system),
34630 Self::TUNNEL(inner) => Some(inner.target_system),
34631 Self::V2_EXTENSION(inner) => Some(inner.target_system),
34632 _ => None,
34633 }
34634 }
34635 fn target_component_id(&self) -> Option<u8> {
34636 match self {
34637 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
34638 Self::CANFD_FRAME(inner) => Some(inner.target_component),
34639 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
34640 Self::CAN_FRAME(inner) => Some(inner.target_component),
34641 Self::COMMAND_ACK(inner) => Some(inner.target_component),
34642 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
34643 Self::COMMAND_INT(inner) => Some(inner.target_component),
34644 Self::COMMAND_LONG(inner) => Some(inner.target_component),
34645 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_component),
34646 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_component),
34647 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
34648 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
34649 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
34650 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
34651 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
34652 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
34653 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
34654 Self::LOGGING_ACK(inner) => Some(inner.target_component),
34655 Self::LOGGING_DATA(inner) => Some(inner.target_component),
34656 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
34657 Self::LOG_ERASE(inner) => Some(inner.target_component),
34658 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
34659 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
34660 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
34661 Self::MISSION_ACK(inner) => Some(inner.target_component),
34662 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
34663 Self::MISSION_COUNT(inner) => Some(inner.target_component),
34664 Self::MISSION_ITEM(inner) => Some(inner.target_component),
34665 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
34666 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
34667 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
34668 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
34669 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
34670 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
34671 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
34672 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
34673 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
34674 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
34675 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
34676 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
34677 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
34678 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
34679 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
34680 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
34681 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
34682 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
34683 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
34684 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
34685 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
34686 Self::PARAM_SET(inner) => Some(inner.target_component),
34687 Self::PING(inner) => Some(inner.target_component),
34688 Self::PLAY_TUNE(inner) => Some(inner.target_component),
34689 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
34690 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
34691 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
34692 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
34693 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
34694 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
34695 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
34696 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
34697 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
34698 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
34699 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
34700 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
34701 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
34702 Self::TIMESYNC(inner) => Some(inner.target_component),
34703 Self::TUNNEL(inner) => Some(inner.target_component),
34704 Self::V2_EXTENSION(inner) => Some(inner.target_component),
34705 _ => None,
34706 }
34707 }
34708}